Added support for showing/hiding options panel, but does not work yet.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 02 May 2014 10:07:13 +0100
changeset 332 1ea99b9d1a1e
parent 331 eaf776286738
child 333 d0698eecaea4
Added support for showing/hiding options panel, but does not work yet.
SmallSense__AbstractDIalog.st
SmallSense__AbstractSearchDialog.st
smallsense.rc
--- a/SmallSense__AbstractDIalog.st	Wed Apr 30 11:59:10 2014 +0100
+++ b/SmallSense__AbstractDIalog.st	Fri May 02 10:07:13 2014 +0100
@@ -3,7 +3,8 @@
 "{ NameSpace: SmallSense }"
 
 SimpleDialog subclass:#AbstractDIalog
-	instanceVariableNames:'buttons buttonsPanelView acceptEnabledHolder'
+	instanceVariableNames:'buttons buttonsPanelView acceptEnabledHolder
+		optionsVisibleLabelHolder optionsVisibleHolder'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Core-Interface-Search'
@@ -11,6 +12,69 @@
 
 !AbstractDIalog class methodsFor:'interface specs'!
 
+dialogSpec
+    "This resource specification was automatically generated
+     by the UIPainter of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the UIPainter may not be able to read the specification."
+
+    "
+     UIPainter new openOnClass:SmallSense::AbstractDIalog andSelector:#dialogSpec
+     SmallSense::AbstractDIalog new openInterface:#dialogSpec
+    "
+
+    <resource: #canvas>
+
+    ^ 
+    #(FullSpec
+       name: dialogSpec
+       window: 
+      (WindowSpec
+         label: 'Search...'
+         name: 'Search...'
+         min: (Point 10 10)
+         bounds: (Rectangle 0 0 708 404)
+         menu: mainMenuSpec
+       )
+       component: 
+      (SpecCollection
+         collection: (
+          (VerticalPanelViewSpec
+             name: 'ContentAndOptionsPanel'
+             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+             horizontalLayout: fit
+             verticalLayout: topSpaceFit
+             horizontalSpace: 3
+             verticalSpace: 3
+             elementsChangeSize: true
+             component: 
+            (SpecCollection
+               collection: (
+                (UISubSpecification
+                   name: 'Content'
+                   minorKey: contentPaneSpec
+                   extent: (Point 708 350)
+                 )
+                (UISubSpecification
+                   name: 'Options'
+                   initiallyInvisible: true
+                   visibilityChannel: optionsVisibleHolder
+                   minorKey: optionsSpec
+                   extent: (Point 708 40)
+                 )
+                )
+              
+             )
+           )
+          )
+        
+       )
+     )
+
+    "Modified: / 02-05-2014 / 00:40:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 windowSpec
     "This resource specification was automatically generated
      by the UIPainter of ST/X."
@@ -86,9 +150,14 @@
        component: 
       (SpecCollection
          collection: (
+          (UISubSpecification
+             name: 'ButtonOptionsShowOrHide'
+             layout: (LayoutFrame 0 0 0 0 100 0 0 1)
+             minorKey: optionsShowHideLeftAlignedPaneSpec
+           )
           (HorizontalPanelViewSpec
              name: 'Buttons'
-             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+             layout: (LayoutFrame 100 0 0 0 0 1 0 1)
              horizontalLayout: right
              verticalLayout: center
              horizontalSpace: 3
@@ -100,6 +169,128 @@
         
        )
      )
+!
+
+contentPaneSpec
+    "This resource specification was automatically generated
+     by the UIPainter of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the UIPainter may not be able to read the specification."
+
+    "
+     UIPainter new openOnClass:SmallSense::AbstractSearchDialog andSelector:#optionsPaneSpec
+     SmallSense::AbstractSearchDialog new openInterface:#optionsPaneSpec
+    "
+
+    <resource: #canvas>
+
+    ^ 
+    #(FullSpec
+       name: contentPaneSpec
+       window: 
+      (WindowSpec
+         label: 'Search ...'
+         name: 'Search Options...'
+         min: (Point 10 10)
+         bounds: (Rectangle 0 0 634 40)
+       )
+       component: 
+      (SpecCollection
+         collection: (
+          (LabelSpec
+             label: 'No content (override #contentPaneSpec)'
+             name: 'NoOptionsLabel'
+             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+             translateLabel: true
+           )
+          )
+        
+       )
+     )
+
+    "Created: / 02-05-2014 / 00:17:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+optionsPaneSpec
+    "This resource specification was automatically generated
+     by the UIPainter of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the UIPainter may not be able to read the specification."
+
+    "
+     UIPainter new openOnClass:SmallSense::AbstractSearchDialog andSelector:#optionsPaneSpec
+     SmallSense::AbstractSearchDialog new openInterface:#optionsPaneSpec
+    "
+
+    <resource: #canvas>
+
+    ^ 
+    #(FullSpec
+       name: optionsPaneSpec
+       window: 
+      (WindowSpec
+         label: 'Search Options...'
+         name: 'Search Options...'
+         min: (Point 10 10)
+         bounds: (Rectangle 0 0 634 40)
+       )
+       component: 
+      (SpecCollection
+         collection: (
+          (LabelSpec
+             label: 'No options (override #optionsPaneSpec)'
+             name: 'NoOptionsLabel'
+             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+             translateLabel: true
+           )
+          )
+        
+       )
+     )
+!
+
+optionsShowHideLeftAlignedPaneSpec
+    "This resource specification was automatically generated
+     by the UIPainter of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the UIPainter may not be able to read the specification."
+
+    "
+     UIPainter new openOnClass:SmallSense::AbstractDIalog andSelector:#optionsShowHideLeftAlignedPaneSpec
+     SmallSense::AbstractDIalog new openInterface:#optionsShowHideLeftAlignedPaneSpec
+    "
+
+    <resource: #canvas>
+
+    ^ 
+    #(FullSpec
+       name: optionsShowHideLeftAlignedPaneSpec
+       window: 
+      (WindowSpec
+         label: 'Show / Hide options'
+         name: 'Show / Hide options'
+         min: (Point 10 10)
+         bounds: (Rectangle 0 0 452 20)
+       )
+       component: 
+      (SpecCollection
+         collection: (
+          (LinkButtonSpec
+             label: 'Options'
+             name: 'ShowHideOptions'
+             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+             translateLabel: true
+             labelChannel: optionsVisibleLabelHolder
+             adjust: left
+             model: doOptionsShowOrHide
+           )
+          )
+        
+       )
+     )
 ! !
 
 !AbstractDIalog class methodsFor:'testing'!
@@ -108,6 +299,14 @@
     ^ self == SmallSense::AbstractDIalog
 ! !
 
+!AbstractDIalog methodsFor:'actions'!
+
+doOptionsShowOrHide
+    self optionsVisibleHolder value: self optionsVisibleHolder value not.
+
+    "Modified: / 02-05-2014 / 00:27:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !AbstractDIalog methodsFor:'adding & removing components'!
 
 addButton: aButton
@@ -170,6 +369,82 @@
 "/       acceptEnabledHolder onChangeSend:#acceptEnabledHolderChanged to:self.
     ].
     ^ acceptEnabledHolder.
+!
+
+optionsVisibleHolder
+    "return/create the 'optionsVisibleHolder' value holder (automatically generated)"
+
+    optionsVisibleHolder isNil ifTrue:[
+        optionsVisibleHolder := false asValue.
+        optionsVisibleHolder addDependent:self.
+    ].
+    ^ optionsVisibleHolder
+
+    "Modified: / 02-05-2014 / 00:26:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+optionsVisibleHolder:something
+    "set the 'optionsVisibleHolder' value holder (automatically generated)"
+
+    |oldValue newValue|
+
+    optionsVisibleHolder notNil ifTrue:[
+        oldValue := optionsVisibleHolder value.
+        optionsVisibleHolder removeDependent:self.
+    ].
+    optionsVisibleHolder := something.
+    optionsVisibleHolder notNil ifTrue:[
+        optionsVisibleHolder addDependent:self.
+    ].
+    newValue := optionsVisibleHolder value.
+    oldValue ~~ newValue ifTrue:[
+        self update:#value with:newValue from:optionsVisibleHolder.
+    ].
+!
+
+optionsVisibleLabelHolder
+    <resource: #uiAspect>
+
+    "automatically generated by UIPainter ..."
+
+    "*** the code below creates a default model when invoked."
+    "*** (which may not be the one you wanted)"
+    "*** Please change as required and accept it in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    optionsVisibleLabelHolder isNil ifTrue:[
+        optionsVisibleLabelHolder := (resources string: 'Options') asValue.
+"/ if your app needs to be notified of changes, uncomment one of the lines below:
+"/       optionsVisibleLabelHolder addDependent:self.
+"/       optionsVisibleLabelHolder onChangeSend:#optionsVisibleLabelHolderChanged to:self.
+    ].
+    ^ optionsVisibleLabelHolder.
+
+    "Modified: / 02-05-2014 / 00:25:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractDIalog methodsFor:'change & update'!
+
+update:something with:aParameter from:changedObject
+    changedObject == optionsVisibleHolder ifTrue:[
+        self updateOptionsVisibleLabel.
+        ^ self.
+    ].     
+    ^ super update:something with:aParameter from:changedObject
+
+    "Created: / 02-05-2014 / 00:29:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+updateOptionsVisibleLabel
+    | label |
+
+    label := 
+        self optionsVisibleHolder value 
+            ifTrue:[ resources string: 'Hide options']
+            ifFalse:[ resources string: 'Options'].
+    self optionsVisibleLabelHolder value: label.
+
+    "Created: / 02-05-2014 / 00:29:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !AbstractDIalog methodsFor:'hooks'!
--- a/SmallSense__AbstractSearchDialog.st	Wed Apr 30 11:59:10 2014 +0100
+++ b/SmallSense__AbstractSearchDialog.st	Fri May 02 10:07:13 2014 +0100
@@ -46,66 +46,6 @@
     "Created: / 28-04-2014 / 23:13:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!AbstractSearchDialog class methodsFor:'interface specs'!
-
-dialogSpec
-    "This resource specification was automatically generated
-     by the UIPainter of ST/X."
-
-    "Do not manually edit this!! If it is corrupted,
-     the UIPainter may not be able to read the specification."
-
-    "
-     UIPainter new openOnClass:SmallSense::AbstractSearchDialog andSelector:#dialogSpec
-     SmallSense::AbstractSearchDialog new openInterface:#dialogSpec
-    "
-
-    <resource: #canvas>
-
-    ^ 
-    #(FullSpec
-       name: 'dialogSpec'
-       window: 
-      (WindowSpec
-         label: 'Search...'
-         name: 'Search...'
-         min: (Point 10 10)
-         bounds: (Rectangle 0 0 708 404)
-         menu: mainMenuSpec
-       )
-       component: 
-      (SpecCollection
-         collection: (
-          (VerticalPanelViewSpec
-             name: 'ContentAndOptionsPanel'
-             layout: (LayoutFrame 10 0 0 0 -10 1 0 1)
-             horizontalLayout: fit
-             verticalLayout: topSpaceFit
-             horizontalSpace: 3
-             verticalSpace: 3
-             component: 
-            (SpecCollection
-               collection: (
-                (UISubSpecification
-                   name: 'SubSpecification1'
-                   minorKey: contentPaneSpec
-                   extent: (Point 688 404)
-                 )
-                (UISubSpecification
-                   name: 'SubSpecification2'
-                   minorKey: optionsPaneSpec
-                   extent: (Point 688 1)
-                 )
-                )
-              
-             )
-           )
-          )
-        
-       )
-     )
-! !
-
 !AbstractSearchDialog class methodsFor:'interface specs-content'!
 
 contentPaneSpec
@@ -198,45 +138,6 @@
         
        )
      )
-!
-
-optionsPaneSpec
-    "This resource specification was automatically generated
-     by the UIPainter of ST/X."
-
-    "Do not manually edit this!! If it is corrupted,
-     the UIPainter may not be able to read the specification."
-
-    "
-     UIPainter new openOnClass:SmallSense::AbstractSearchDialog andSelector:#optionsPaneSpec
-     SmallSense::AbstractSearchDialog new openInterface:#optionsPaneSpec
-    "
-
-    <resource: #canvas>
-
-    ^ 
-    #(FullSpec
-       name: optionsPaneSpec
-       window: 
-      (WindowSpec
-         label: 'Search Options...'
-         name: 'Search Options...'
-         min: (Point 10 10)
-         bounds: (Rectangle 0 0 634 40)
-       )
-       component: 
-      (SpecCollection
-         collection: (
-          (LabelSpec
-             label: 'No options (override #optionsPaneSpec)'
-             name: 'NoOptionsLabel'
-             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
-             translateLabel: true
-           )
-          )
-        
-       )
-     )
 ! !
 
 !AbstractSearchDialog class methodsFor:'queries'!
--- a/smallsense.rc	Wed Apr 30 11:59:10 2014 +0100
+++ b/smallsense.rc	Fri May 02 10:07:13 2014 +0100
@@ -3,7 +3,7 @@
 // automagically generated from the projectDefinition: jv_smallsense.
 //
 VS_VERSION_INFO VERSIONINFO
-  FILEVERSION     6,2,24,24
+  FILEVERSION     6,2,32767,32767
   PRODUCTVERSION  6,2,3,0
 #if (__BORLANDC__)
   FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
@@ -20,12 +20,12 @@
     BEGIN
       VALUE "CompanyName", "eXept Software AG\0"
       VALUE "FileDescription", "Smalltalk/X Class library (LIB)\0"
-      VALUE "FileVersion", "6.2.24.24\0"
+      VALUE "FileVersion", "6.2.32767.32767\0"
       VALUE "InternalName", "jv:smallsense\0"
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Mon, 28 Apr 2014 23:11:13 GMT\0"
+      VALUE "ProductDate", "Fri, 02 May 2014 09:06:24 GMT\0"
     END
 
   END