diff options
| author | Tomáš Znamenáček | 2015-01-09 10:51:08 +0100 | 
|---|---|---|
| committer | Tomáš Znamenáček | 2015-01-09 10:53:45 +0100 | 
| commit | f63c21e11cfad4fb8408effae2efb07164ad5760 (patch) | |
| tree | 3a5fce47c17b3a0986c684df0b4e9fda2bb8acd3 /Demo/MainMenu.xib | |
| parent | fc43b570c7ea4802c648670b39586425ce330cec (diff) | |
| download | MASShortcut-f63c21e11cfad4fb8408effae2efb07164ad5760.tar.bz2 | |
Expanded demo functionality (preparing for 2.0.0, see #54).
Mostly back to the previous version with enable/disable checkboxes &
one settable and one hard-coded shortcut. I have tried to come up with
a nicer pattern to watch the enabled/disabled checkboxes, but without
external dependencies like Facebook’s KVOController I didn’t come up
with anything better than plain old KVO.
Diffstat (limited to 'Demo/MainMenu.xib')
| -rw-r--r-- | Demo/MainMenu.xib | 58 | 
1 files changed, 47 insertions, 11 deletions
| diff --git a/Demo/MainMenu.xib b/Demo/MainMenu.xib index 488dea2..3d99587 100644 --- a/Demo/MainMenu.xib +++ b/Demo/MainMenu.xib @@ -649,39 +649,75 @@          </menu>          <window title="Demo" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" frameAutosaveName="DemoWindow" animationBehavior="default" id="371">              <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/> -            <rect key="contentRect" x="335" y="390" width="290" height="171"/> +            <rect key="contentRect" x="335" y="390" width="385" height="129"/>              <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1057"/>              <view key="contentView" id="372"> -                <rect key="frame" x="0.0" y="0.0" width="290" height="171"/> +                <rect key="frame" x="0.0" y="0.0" width="385" height="129"/>                  <autoresizingMask key="autoresizingMask"/>                  <subviews>                      <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="536" customClass="MASShortcutView"> -                        <rect key="frame" x="20" y="102" width="250" height="19"/> +                        <rect key="frame" x="142" y="90" width="158" height="19"/>                      </customView>                      <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PG0-jh-Onh"> -                        <rect key="frame" x="18" y="134" width="119" height="17"/> -                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Record a shortcut:" id="85u-1A-n7H"> +                        <rect key="frame" x="18" y="92" width="111" height="17"/> +                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Custom shortcut:" id="85u-1A-n7H">                              <font key="font" metaFont="system"/>                              <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>                              <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>                          </textFieldCell>                      </textField> -                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ieo-bz-mir"> -                        <rect key="frame" x="18" y="23" width="254" height="68"/> -                        <textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="left" id="WDe-Rt-e8p"> +                    <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zCi-ki-Uuh"> +                        <rect key="frame" x="140" y="63" width="169" height="18"/> +                        <buttonCell key="cell" type="check" title="Enable custom shortcut" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="Y47-p3-sDa"> +                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> +                            <font key="font" metaFont="system"/> +                        </buttonCell> +                        <connections> +                            <binding destination="rCO-Ve-DT5" name="value" keyPath="values.customShortcutEnabled" id="VjS-3V-VdA"/> +                        </connections> +                    </button> +                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="KnS-ut-phz"> +                        <rect key="frame" x="18" y="65" width="111" height="17"/> +                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Options:" id="cUE-gA-heG"> +                            <font key="font" metaFont="system"/> +                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> +                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> +                        </textFieldCell> +                    </textField> +                    <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="F4r-KM-wn9"> +                        <rect key="frame" x="140" y="43" width="227" height="18"/> +                        <buttonCell key="cell" type="check" title="Enable hard-coded shortcut (⌘2)" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="7gv-jN-44g"> +                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> +                            <font key="font" metaFont="system"/> +                        </buttonCell> +                        <connections> +                            <binding destination="rCO-Ve-DT5" name="value" keyPath="values.hardcodedShortcutEnabled" id="dlZ-si-HeN"/> +                        </connections> +                    </button> +                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9fB-XS-8pK"> +                        <rect key="frame" x="18" y="20" width="111" height="17"/> +                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Feedback:" id="Zbz-mV-NDc">                              <font key="font" metaFont="system"/> -                            <string key="title">After recording a shortcut, press it to play a sound. Notice that the shortcut is played even when the demo app is not in the foreground.</string>                              <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>                              <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>                          </textFieldCell>                      </textField> +                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Aso-dH-W8I"> +                        <rect key="frame" x="140" y="20" width="211" height="17"/> +                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" placeholderString="Press a shortcut to see feedback" id="Ckx-v7-e6x"> +                            <font key="font" metaFont="system"/> +                            <color key="textColor" red="1" green="0.14901961389999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/> +                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> +                        </textFieldCell> +                    </textField>                  </subviews>              </view> -            <point key="canvasLocation" x="297" y="335.5"/> +            <point key="canvasLocation" x="348.5" y="367.5"/>          </window>          <customObject id="494" customClass="AppDelegate">              <connections> -                <outlet property="shortcutView" destination="536" id="548"/> +                <outlet property="customShortcutView" destination="536" id="aO6-hh-1vm"/> +                <outlet property="feedbackTextField" destination="Aso-dH-W8I" id="hk8-xL-ieC"/>                  <outlet property="window" destination="371" id="532"/>              </connections>          </customObject> | 
