Skip to content

Commit

Permalink
add hint buttons to all gadgets
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcoles committed Jul 9, 2024
1 parent 0941266 commit b7fc181
Show file tree
Hide file tree
Showing 29 changed files with 790 additions and 119 deletions.
41 changes: 31 additions & 10 deletions ListViewObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ OPT MODULE, OSVERSION=37

MODULE '*reactionObject','*reactionForm','*listPicker','*stringlist','*reactionListObject','*reactionLists','*sourceGen','*validator'

EXPORT ENUM LVIEWGAD_IDENT, LVIEWGAD_LISTSELECT, LVIEWGAD_MULTISELECT,
EXPORT ENUM LVIEWGAD_IDENT, LVIEWGAD_HINT, LVIEWGAD_LISTSELECT, LVIEWGAD_MULTISELECT,
LVIEWGAD_OK, LVIEWGAD_CHILD, LVIEWGAD_CANCEL


Expand Down Expand Up @@ -88,22 +88,33 @@ PROC create() OF listViewSettingsForm
LABEL_TEXT, 'Identifier',
LabelEnd,

LAYOUT_ADDCHILD, self.gadgetList[ LVIEWGAD_HINT ]:=ButtonObject,
GA_ID, LVIEWGAD_HINT,
GA_TEXT, 'Hint',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LayoutEnd,

LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,

LAYOUT_ADDCHILD, self.gadgetList[ LVIEWGAD_LISTSELECT ]:=ButtonObject,
GA_ID, LVIEWGAD_LISTSELECT,
GA_TEXT, '_Pick a List',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,

LAYOUT_ADDCHILD, self.gadgetList[ LVIEWGAD_MULTISELECT ]:=CheckBoxObject,
GA_ID, LVIEWGAD_MULTISELECT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'Multi-select',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LayoutEnd,

LAYOUT_ADDCHILD, self.gadgetList[ LVIEWGAD_MULTISELECT ]:=CheckBoxObject,
GA_ID, LVIEWGAD_MULTISELECT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'Multi-select',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,

LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,

Expand Down Expand Up @@ -134,6 +145,7 @@ PROC create() OF listViewSettingsForm

self.gadgetActions[LVIEWGAD_LISTSELECT]:={selectList}
self.gadgetActions[LVIEWGAD_CHILD]:={editChildSettings}
self.gadgetActions[LVIEWGAD_HINT]:={editHint}
self.gadgetActions[LVIEWGAD_CANCEL]:=MR_CANCEL
self.gadgetActions[LVIEWGAD_OK]:=MR_OK
ENDPROC
Expand Down Expand Up @@ -174,12 +186,21 @@ EXPORT PROC canClose(modalRes) OF listViewSettingsForm
ENDIF
ENDPROC TRUE

PROC editHint(nself,gadget,id,code) OF listViewSettingsForm
self:=nself
self.setBusy()
self.listViewObject.editHint()
self.clearBusy()
self.updateHint(LVIEWGAD_HINT, self.listViewObject.hintText)
ENDPROC

PROC editSettings(comp:PTR TO listViewObject) OF listViewSettingsForm
DEF res

self.listViewObject:=comp
self.selectedListId:=comp.listObjectId


self.updateHint(LVIEWGAD_HINT, comp.hintText)
SetGadgetAttrsA(self.gadgetList[ LVIEWGAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[ LVIEWGAD_MULTISELECT ],0,0,[LVIEWGAD_MULTISELECT,comp.multiSelect,0])

Expand Down
22 changes: 20 additions & 2 deletions SpeedBarObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ OPT MODULE, OSVERSION=37

MODULE '*reactionObject','*reactionForm','*colourPicker','*sourcegen','*stringlist','*validator'

EXPORT ENUM SBARGAD_IDENT,SBARGAD_NAME, SBARGAD_BTNLIST, SBARGAD_BUTTON_TEXT, SBARGAD_BUTTON_TYPE, SBARGAD_BUTTON_ADD, SBARGAD_BUTTON_DEL, SBARGAD_ORIENTATION, SBARGAD_BGPEN,
EXPORT ENUM SBARGAD_IDENT,SBARGAD_NAME, SBARGAD_HINT, SBARGAD_BTNLIST, SBARGAD_BUTTON_TEXT, SBARGAD_BUTTON_TYPE, SBARGAD_BUTTON_ADD, SBARGAD_BUTTON_DEL, SBARGAD_ORIENTATION, SBARGAD_BGPEN,
SBARGAD_STRUMBAR, SBARGAD_BEVELSTYLE,
SBARGAD_OK, SBARGAD_CHILD, SBARGAD_CANCEL

Expand Down Expand Up @@ -189,6 +189,14 @@ PROC create() OF speedBarSettingsForm
LABEL_TEXT, 'Identifier',
LabelEnd,

LAYOUT_ADDCHILD, self.gadgetList[ SBARGAD_HINT ]:=ButtonObject,
GA_ID, SBARGAD_HINT,
GA_TEXT, 'Hint',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDWIDTH,50,

LAYOUT_ADDCHILD, self.gadgetList[ SBARGAD_BGPEN ]:=ButtonObject,
GA_ID, SBARGAD_BGPEN,
GA_TEXT, 'Back_groundPen',
Expand Down Expand Up @@ -321,6 +329,7 @@ PROC create() OF speedBarSettingsForm
self.gadgetActions[SBARGAD_BTNLIST]:={selectItem}
self.gadgetActions[SBARGAD_BGPEN]:={selectPen}
self.gadgetActions[SBARGAD_CHILD]:={editChildSettings}
self.gadgetActions[SBARGAD_HINT]:={editHint}
self.gadgetActions[SBARGAD_CANCEL]:=MR_CANCEL
self.gadgetActions[SBARGAD_BUTTON_ADD]:={addItem}
self.gadgetActions[SBARGAD_BUTTON_DEL]:={deleteItem}
Expand Down Expand Up @@ -375,6 +384,14 @@ EXPORT PROC canClose(modalRes) OF speedBarSettingsForm
ENDIF
ENDPROC TRUE

PROC editHint(nself,gadget,id,code) OF speedBarSettingsForm
self:=nself
self.setBusy()
self.speedBarObject.editHint()
self.clearBusy()
self.updateHint(SBARGAD_HINT, self.speedBarObject.hintText)
ENDPROC

PROC editSettings(comp:PTR TO speedBarObject) OF speedBarSettingsForm
DEF res,i,n
DEF typeStr[10]:STRING
Expand All @@ -383,7 +400,8 @@ PROC editSettings(comp:PTR TO speedBarObject) OF speedBarSettingsForm
self.speedBarObject:=comp

self.tempBgPen:=comp.bgPen


self.updateHint(SBARGAD_HINT, comp.hintText)
SetGadgetAttrsA(self.gadgetList[SBARGAD_BTNLIST],0,0,[LISTBROWSER_LABELS, Not(0), TAG_END])
FOR i:=0 TO comp.buttonList.count()-1
self.tempItems.add(comp.buttonList.item(i))
Expand Down
30 changes: 28 additions & 2 deletions buttonObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ OPT MODULE, OSVERSION=37

MODULE '*reactionObject','*reactionForm','*colourPicker','*sourceGen','*validator'

EXPORT ENUM BTNGAD_IDENT, BTNGAD_NAME, BTNGAD_TEXTPEN, BTNGAD_BGPEN, BTNGAD_FILLTEXTPEN, BTNGAD_FILLPEN,
EXPORT ENUM BTNGAD_IDENT, BTNGAD_NAME, BTNGAD_HINT, BTNGAD_TEXTPEN, BTNGAD_BGPEN, BTNGAD_FILLTEXTPEN, BTNGAD_FILLPEN,
BTNGAD_AUTOBUTTON, BTNGAD_BEVELSTYLE, BTNGAD_JUSTIFICATION, BTNGAD_SELECTED,
BTNGAD_DISABLED, BTNGAD_READONLY, BTNGAD_PUSHBUTTON, BTNGAD_TRANSPARENT,
BTNGAD_OK, BTNGAD_CHILD, BTNGAD_CANCEL
Expand Down Expand Up @@ -101,7 +101,6 @@ PROC create() OF buttonSettingsForm
LABEL_TEXT, 'Identifier',
LabelEnd,


LAYOUT_ADDCHILD, self.gadgetList[ BTNGAD_NAME ]:=StringObject,
GA_ID, BTNGAD_NAME,
GA_RELVERIFY, TRUE,
Expand All @@ -112,6 +111,14 @@ PROC create() OF buttonSettingsForm
CHILD_LABEL, LabelObject,
LABEL_TEXT, '_Label',
LabelEnd,

LAYOUT_ADDCHILD, self.gadgetList[ BTNGAD_HINT ]:=ButtonObject,
GA_ID, BTNGAD_HINT,
GA_TEXT, 'Hint',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDWIDTH,50,
LayoutEnd,

LAYOUT_ADDCHILD, LayoutObject,
Expand Down Expand Up @@ -266,6 +273,14 @@ PROC create() OF buttonSettingsForm
GA_TABCYCLE, TRUE,
ButtonEnd,

/*
LAYOUT_ADDCHILD, self.gadgetList[ BTNGAD_HINT ]:=ButtonObject,
GA_ID, BTNGAD_HINT,
GA_TEXT, 'Hint',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,*/

LAYOUT_ADDCHILD, self.gadgetList[ BTNGAD_CANCEL ]:=ButtonObject,
GA_ID, BTNGAD_CANCEL,
GA_TEXT, '_Cancel',
Expand All @@ -278,6 +293,7 @@ PROC create() OF buttonSettingsForm
WindowEnd

self.gadgetActions[BTNGAD_CHILD]:={editChildSettings}
self.gadgetActions[BTNGAD_HINT]:={editHint}
self.gadgetActions[BTNGAD_CANCEL]:=MR_CANCEL
self.gadgetActions[BTNGAD_OK]:=MR_OK

Expand All @@ -294,6 +310,14 @@ PROC editChildSettings(nself,gadget,id,code) OF buttonSettingsForm
self.clearBusy()
ENDPROC

PROC editHint(nself,gadget,id,code) OF buttonSettingsForm
self:=nself
self.setBusy()
self.buttonObject.editHint()
self.clearBusy()
self.updateHint(BTNGAD_HINT, self.buttonObject.hintText)
ENDPROC

PROC selectPen(nself,gadget,id,code) OF buttonSettingsForm
DEF frmColourPicker:PTR TO colourPickerForm
DEF selColour
Expand Down Expand Up @@ -348,6 +372,8 @@ PROC editSettings(comp:PTR TO buttonObject) OF buttonSettingsForm
self.tmpBgPen:=comp.bgPen
self.tmpFillTextPen:=comp.fillTextPen
self.tmpFillPen:=comp.fillPen

self.updateHint(BTNGAD_HINT, comp.hintText)

SetGadgetAttrsA(self.gadgetList[ BTNGAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[ BTNGAD_NAME ],0,0,[STRINGA_TEXTVAL,comp.name,0])
Expand Down
22 changes: 21 additions & 1 deletion checkboxObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OPT MODULE, OSVERSION=37

MODULE '*reactionObject','*reactionForm','*colourPicker','*sourcegen','*validator'

EXPORT ENUM CHKGAD_IDENT, CHKGAD_NAME, CHKGAD_TEXTPEN, CHKGAD_BGPEN, CHKGAD_FILLTEXTPEN,
EXPORT ENUM CHKGAD_IDENT, CHKGAD_NAME, CHKGAD_HINT, CHKGAD_TEXTPEN, CHKGAD_BGPEN, CHKGAD_FILLTEXTPEN,
CHKGAD_DISABLED, CHKGAD_SELECTED, CHKGAD_LABELPLACE,
CHKGAD_OK, CHKGAD_CHILD, CHKGAD_CANCEL

Expand Down Expand Up @@ -101,6 +101,14 @@ PROC create() OF checkboxSettingsForm
CHILD_LABEL, LabelObject,
LABEL_TEXT, '_Label',
LabelEnd,

LAYOUT_ADDCHILD, self.gadgetList[ CHKGAD_HINT ]:=ButtonObject,
GA_ID, CHKGAD_HINT,
GA_TEXT, 'Hint',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDWIDTH,50,
LayoutEnd,

LAYOUT_ADDCHILD, LayoutObject,
Expand Down Expand Up @@ -198,6 +206,7 @@ PROC create() OF checkboxSettingsForm
self.gadgetActions[CHKGAD_BGPEN]:={selectPen}
self.gadgetActions[CHKGAD_FILLTEXTPEN]:={selectPen}
self.gadgetActions[CHKGAD_CHILD]:={editChildSettings}
self.gadgetActions[CHKGAD_HINT]:={editHint}
self.gadgetActions[CHKGAD_CANCEL]:=MR_CANCEL
self.gadgetActions[CHKGAD_OK]:=MR_OK
ENDPROC
Expand All @@ -209,6 +218,14 @@ PROC editChildSettings(nself,gadget,id,code) OF checkboxSettingsForm
self.clearBusy()
ENDPROC

PROC editHint(nself,gadget,id,code) OF checkboxSettingsForm
self:=nself
self.setBusy()
self.checkboxObject.editHint()
self.clearBusy()
self.updateHint(CHKGAD_HINT, self.checkboxObject.hintText)
ENDPROC

PROC selectPen(nself,gadget,id,code) OF checkboxSettingsForm
DEF frmColourPicker:PTR TO colourPickerForm
DEF selColour
Expand Down Expand Up @@ -258,6 +275,9 @@ PROC editSettings(comp:PTR TO checkboxObject) OF checkboxSettingsForm
self.tempTextPen:=comp.textPen
self.tempBgPen:=comp.bgPen
self.tempFillTextPen:=comp.fillTextPen

self.updateHint(CHKGAD_HINT, comp.hintText)

SetGadgetAttrsA(self.gadgetList[ CHKGAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[ CHKGAD_NAME ],0,0,[STRINGA_TEXTVAL,comp.name,0])
SetGadgetAttrsA(self.gadgetList[ CHKGAD_DISABLED ],0,0,[CHECKBOX_CHECKED,comp.disabled,0])
Expand Down
21 changes: 20 additions & 1 deletion chooserObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OPT MODULE, OSVERSION=37

MODULE '*reactionObject','*reactionForm','*listPicker','*stringlist','*reactionListObject','*reactionLists','*sourceGen','*validator'

EXPORT ENUM CHOOSER_GAD_IDENT, CHOOSER_GAD_NAME, CHOOSER_GAD_LISTSELECT,
EXPORT ENUM CHOOSER_GAD_IDENT, CHOOSER_GAD_NAME, CHOOSER_GAD_HINT, CHOOSER_GAD_LISTSELECT,
CHOOSER_GAD_MAXLABELS, CHOOSER_GAD_ACTIVE, CHOOSER_GAD_WIDTH,
CHOOSER_GAD_READONLY, CHOOSER_GAD_DISABLED, CHOOSER_GAD_AUTOFIT,
CHOOSER_GAD_POPUP, CHOOSER_GAD_DROPDOWN,
Expand Down Expand Up @@ -102,6 +102,14 @@ PROC create() OF chooserSettingsForm
CHILD_LABEL, LabelObject,
LABEL_TEXT, '_Label',
LabelEnd,

LAYOUT_ADDCHILD, self.gadgetList[ CHOOSER_GAD_HINT ]:=ButtonObject,
GA_ID, CHOOSER_GAD_HINT,
GA_TEXT, 'Hint',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDWIDTH,50,

LAYOUT_ADDCHILD, self.gadgetList[ CHOOSER_GAD_LISTSELECT ]:=ButtonObject,
GA_ID, CHOOSER_GAD_LISTSELECT,
Expand Down Expand Up @@ -223,6 +231,7 @@ PROC create() OF chooserSettingsForm

self.gadgetActions[CHOOSER_GAD_LISTSELECT]:={selectList}
self.gadgetActions[CHOOSER_GAD_CHILD]:={editChildSettings}
self.gadgetActions[CHOOSER_GAD_HINT]:={editHint}
self.gadgetActions[CHOOSER_GAD_CANCEL]:=MR_CANCEL
self.gadgetActions[CHOOSER_GAD_OK]:=MR_OK
ENDPROC
Expand All @@ -242,6 +251,14 @@ PROC selectList(nself,gadget,id,code) OF chooserSettingsForm
self.clearBusy()
ENDPROC

PROC editHint(nself,gadget,id,code) OF chooserSettingsForm
self:=nself
self.setBusy()
self.chooserObject.editHint()
self.clearBusy()
self.updateHint(CHOOSER_GAD_HINT, self.chooserObject.hintText)
ENDPROC

PROC editChildSettings(nself,gadget,id,code) OF chooserSettingsForm
self:=nself
self.setBusy()
Expand Down Expand Up @@ -269,6 +286,8 @@ PROC editSettings(comp:PTR TO chooserObject) OF chooserSettingsForm
self.chooserObject:=comp
self.selectedListId:=comp.listObjectId

self.updateHint(CHOOSER_GAD_HINT, comp.hintText)

SetGadgetAttrsA(self.gadgetList[ CHOOSER_GAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[ CHOOSER_GAD_NAME ],0,0,[STRINGA_TEXTVAL,comp.name,0])

Expand Down
20 changes: 19 additions & 1 deletion clickTabObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ OPT MODULE, OSVERSION=37

MODULE '*reactionObject','*reactionForm','*listPicker','*stringlist','*reactionListObject','*reactionLists','*sourceGen','*validator'

EXPORT ENUM CLICKTAB_GAD_IDENT,CLICKTAB_GAD_LISTSELECT,
EXPORT ENUM CLICKTAB_GAD_IDENT,CLICKTAB_GAD_HINT, CLICKTAB_GAD_LISTSELECT,
CLICKTAB_GAD_TOP, CLICKTAB_GAD_LEFT, CLICKTAB_GAD_HEIGHT,
CLICKTAB_GAD_CURRENT, CLICKTAB_GAD_DISABLED,
CLICKTAB_GAD_OK, CLICKTAB_GAD_CHILD, CLICKTAB_GAD_CANCEL
Expand Down Expand Up @@ -94,6 +94,13 @@ PROC create() OF clickTabSettingsForm
LABEL_TEXT, 'Identifier',
LabelEnd,

LAYOUT_ADDCHILD, self.gadgetList[ CLICKTAB_GAD_HINT ]:=ButtonObject,
GA_ID, CLICKTAB_GAD_HINT,
GA_TEXT, 'Hint',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,

LAYOUT_ADDCHILD, self.gadgetList[ CLICKTAB_GAD_LISTSELECT ]:=ButtonObject,
GA_ID, CLICKTAB_GAD_LISTSELECT,
GA_TEXT, '_Pick a List',
Expand Down Expand Up @@ -187,6 +194,7 @@ PROC create() OF clickTabSettingsForm

self.gadgetActions[CLICKTAB_GAD_LISTSELECT]:={selectList}
self.gadgetActions[CLICKTAB_GAD_CHILD]:={editChildSettings}
self.gadgetActions[CLICKTAB_GAD_HINT]:={editHint}
self.gadgetActions[CLICKTAB_GAD_CANCEL]:=MR_CANCEL
self.gadgetActions[CLICKTAB_GAD_OK]:=MR_OK
ENDPROC
Expand All @@ -206,6 +214,14 @@ PROC selectList(nself,gadget,id,code) OF clickTabSettingsForm
self.clearBusy()
ENDPROC

PROC editHint(nself,gadget,id,code) OF clickTabSettingsForm
self:=nself
self.setBusy()
self.clickTabObject.editHint()
self.clearBusy()
self.updateHint(CLICKTAB_GAD_HINT, self.clickTabObject.hintText)
ENDPROC

PROC editChildSettings(nself,gadget,id,code) OF clickTabSettingsForm
self:=nself
self.setBusy()
Expand Down Expand Up @@ -233,6 +249,8 @@ PROC editSettings(comp:PTR TO clickTabObject) OF clickTabSettingsForm
self.clickTabObject:=comp
self.selectedListId:=comp.listObjectId

self.updateHint(CLICKTAB_GAD_HINT, comp.hintText)

SetGadgetAttrsA(self.gadgetList[ CLICKTAB_GAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[ CLICKTAB_GAD_TOP ],0,0,[INTEGER_NUMBER,comp.top,0])
SetGadgetAttrsA(self.gadgetList[ CLICKTAB_GAD_LEFT ],0,0,[INTEGER_NUMBER,comp.left,0])
Expand Down
Loading

0 comments on commit b7fc181

Please sign in to comment.