Skip to content

Commit

Permalink
add identifier to remaining gadgets
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcoles committed Jul 4, 2024
1 parent b18aa20 commit 5db6953
Show file tree
Hide file tree
Showing 19 changed files with 531 additions and 150 deletions.
22 changes: 17 additions & 5 deletions SpeedBarObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ OPT MODULE, OSVERSION=37
'intuition/imageclass',
'intuition/gadgetclass'

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

EXPORT ENUM 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_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 @@ -178,14 +178,15 @@ PROC create() OF speedBarSettingsForm

LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ SBARGAD_NAME ]:=StringObject,
GA_ID, SBARGAD_NAME,

LAYOUT_ADDCHILD, self.gadgetList[ SBARGAD_IDENT ]:=StringObject,
GA_ID, SBARGAD_IDENT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, 'SpeedBar Name',
LABEL_TEXT, 'Identifier',
LabelEnd,

LAYOUT_ADDCHILD, self.gadgetList[ SBARGAD_BGPEN ]:=ButtonObject,
Expand Down Expand Up @@ -365,6 +366,15 @@ PROC end() OF speedBarSettingsForm
END self.gadgetActions[NUM_SBAR_GADS]
ENDPROC

EXPORT PROC canClose(modalRes) OF speedBarSettingsForm
DEF res
IF modalRes=MR_CANCEL THEN RETURN TRUE

IF checkIdent(self,self.speedBarObject,SBARGAD_IDENT)=FALSE
RETURN FALSE
ENDIF
ENDPROC TRUE

PROC editSettings(comp:PTR TO speedBarObject) OF speedBarSettingsForm
DEF res,i,n
DEF typeStr[10]:STRING
Expand Down Expand Up @@ -392,13 +402,15 @@ PROC editSettings(comp:PTR TO speedBarObject) OF speedBarSettingsForm
SetGadgetAttrsA(self.gadgetList[SBARGAD_BTNLIST],0,0,[LISTBROWSER_LABELS, self.browserlist, TAG_END])
self.selectItem(self,0,0,-1)

SetGadgetAttrsA(self.gadgetList[ SBARGAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[ SBARGAD_NAME ],0,0,[STRINGA_TEXTVAL,comp.name,0])
SetGadgetAttrsA(self.gadgetList[ SBARGAD_STRUMBAR ],0,0,[CHECKBOX_CHECKED,comp.strumBar,0])
SetGadgetAttrsA(self.gadgetList[ SBARGAD_ORIENTATION ],0,0,[CHOOSER_SELECTED,comp.orientation,0])
SetGadgetAttrsA(self.gadgetList[ SBARGAD_BEVELSTYLE ],0,0,[CHOOSER_SELECTED,comp.bevelStyle,0])

res:=self.showModal()
IF res=MR_OK
AstrCopy(comp.ident,Gets(self.gadgetList[ SBARGAD_IDENT ],STRINGA_TEXTVAL))
AstrCopy(comp.name,Gets(self.gadgetList[ SBARGAD_NAME ],STRINGA_TEXTVAL))
comp.bgPen:=self.tempBgPen
comp.strumBar:=Gets(self.gadgetList[ SBARGAD_STRUMBAR ],CHECKBOX_CHECKED)
Expand Down
47 changes: 36 additions & 11 deletions bevelObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ OPT MODULE, OSVERSION=37
'intuition/imageclass',
'intuition/gadgetclass'

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

EXPORT ENUM BEVELGAD_NAME, BEVELGAD_LEFT, BEVELGAD_TOP, BEVELGAD_WIDTH, BEVELGAD_HEIGHT,
EXPORT ENUM BEVELGAD_IDENT, BEVELGAD_NAME, BEVELGAD_LEFT, BEVELGAD_TOP, BEVELGAD_WIDTH, BEVELGAD_HEIGHT,
BEVELGAD_FILLPEN, BEVELGAD_TEXTPEN, BEVELGAD_STYLE, BEVELGAD_PLACETEXT,
BEVELGAD_HIGHLIGHTPEN, BEVELGAD_FOREGROUNDPEN, BEVELGAD_BACKGROUNDPEN, BEVELGAD_SHADOWPEN,
BEVELGAD_RECESSED, BEVELGAD_EDGESONLY, BEVELGAD_TRANSPARENT,
Expand Down Expand Up @@ -99,17 +99,31 @@ PROC create() OF bevelSettingsForm
LAYOUT_SPACEOUTER, TRUE,
LAYOUT_DEFERLAYOUT, TRUE,

LAYOUT_ADDCHILD, self.gadgetList[ BEVELGAD_NAME ]:=StringObject,
GA_ID, BEVELGAD_NAME,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,

CHILD_LABEL, LabelObject,
LABEL_TEXT, '_Bevel Name',
LabelEnd,
LAYOUT_ADDCHILD, self.gadgetList[ BEVELGAD_IDENT ]:=StringObject,
GA_ID, BEVELGAD_IDENT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,

CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Identifier',
LabelEnd,

LAYOUT_ADDCHILD, self.gadgetList[ BEVELGAD_NAME ]:=StringObject,
GA_ID, BEVELGAD_NAME,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,

CHILD_LABEL, LabelObject,
LABEL_TEXT, '_Label',
LabelEnd,
LayoutEnd,

LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
Expand Down Expand Up @@ -382,6 +396,15 @@ PROC end() OF bevelSettingsForm
END self.gadgetActions[NUM_BEVEL_GADS]
ENDPROC

EXPORT PROC canClose(modalRes) OF bevelSettingsForm
DEF res
IF modalRes=MR_CANCEL THEN RETURN TRUE

IF checkIdent(self,self.bevelObject,BEVELGAD_IDENT)=FALSE
RETURN FALSE
ENDIF
ENDPROC TRUE

PROC editSettings(comp:PTR TO bevelObject) OF bevelSettingsForm
DEF res

Expand All @@ -390,6 +413,7 @@ PROC editSettings(comp:PTR TO bevelObject) OF bevelSettingsForm
self.tmpFillPen:=comp.fillPen
self.tmpTextPen:=comp.textPen

SetGadgetAttrsA(self.gadgetList[ BEVELGAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[ BEVELGAD_NAME ],0,0,[STRINGA_TEXTVAL,comp.name,0])
SetGadgetAttrsA(self.gadgetList[ BEVELGAD_LEFT ],0,0,[INTEGER_NUMBER,comp.left,0])
SetGadgetAttrsA(self.gadgetList[ BEVELGAD_TOP ],0,0,[INTEGER_NUMBER,comp.top,0])
Expand All @@ -409,6 +433,7 @@ PROC editSettings(comp:PTR TO bevelObject) OF bevelSettingsForm

res:=self.showModal()
IF res=MR_OK
AstrCopy(comp.ident,Gets(self.gadgetList[ BEVELGAD_IDENT ],STRINGA_TEXTVAL))
AstrCopy(comp.name,Gets(self.gadgetList[ BEVELGAD_NAME ],STRINGA_TEXTVAL))
comp.fillPen:=self.tmpFillPen
comp.textPen:=self.tmpTextPen
Expand Down
26 changes: 24 additions & 2 deletions bitmapObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ OPT MODULE, OSVERSION=37
'intuition/imageclass',
'intuition/gadgetclass'

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

EXPORT DEF errorState

EXPORT ENUM BITMAPGAD_NAME, BITMAPGAD_LEFTEDGE, BITMAPGAD_TOPEDGE,
EXPORT ENUM BITMAPGAD_IDENT, BITMAPGAD_LEFTEDGE, BITMAPGAD_TOPEDGE,
BITMAPGAD_WIDTH, BITMAPGAD_HEIGHT, BITMAPGAD_SOURCEFILE, BITMAPGAD_MASKING,
BITMAPGAD_OK, BITMAPGAD_CHILD, BITMAPGAD_CANCEL

Expand Down Expand Up @@ -75,6 +75,17 @@ PROC create() OF bitmapSettingsForm
LAYOUT_SPACEOUTER, TRUE,
LAYOUT_DEFERLAYOUT, TRUE,

LAYOUT_ADDCHILD, self.gadgetList[ BITMAPGAD_IDENT ]:=StringObject,
GA_ID, BITMAPGAD_IDENT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,

CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Identifier',
LabelEnd,

LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,

Expand Down Expand Up @@ -201,11 +212,21 @@ PROC end() OF bitmapSettingsForm
END self.gadgetActions[NUM_BITMAP_GADS]
ENDPROC

EXPORT PROC canClose(modalRes) OF bitmapSettingsForm
DEF res
IF modalRes=MR_CANCEL THEN RETURN TRUE

IF checkIdent(self,self.bitmapObject,BITMAPGAD_IDENT)=FALSE
RETURN FALSE
ENDIF
ENDPROC TRUE

PROC editSettings(comp:PTR TO bitmapObject) OF bitmapSettingsForm
DEF res

self.bitmapObject:=comp

SetGadgetAttrsA(self.gadgetList[ BITMAPGAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[ BITMAPGAD_SOURCEFILE ],0,0,[GETFILE_FULLFILE,comp.sourceFile,0])
SetGadgetAttrsA(self.gadgetList[ BITMAPGAD_LEFTEDGE ],0,0,[INTEGER_NUMBER,comp.leftEdge,0])
SetGadgetAttrsA(self.gadgetList[ BITMAPGAD_TOPEDGE ],0,0,[INTEGER_NUMBER,comp.topEdge,0])
Expand All @@ -215,6 +236,7 @@ PROC editSettings(comp:PTR TO bitmapObject) OF bitmapSettingsForm

res:=self.showModal()
IF res=MR_OK
AstrCopy(comp.ident,Gets(self.gadgetList[ BITMAPGAD_IDENT ],STRINGA_TEXTVAL))
AstrCopy(comp.sourceFile,Gets(self.gadgetList[ BITMAPGAD_SOURCEFILE ],GETFILE_FULLFILE),255)
comp.leftEdge:=Gets(self.gadgetList[ BITMAPGAD_LEFTEDGE ],INTEGER_NUMBER)
comp.topEdge:=Gets(self.gadgetList[ BITMAPGAD_TOPEDGE ],INTEGER_NUMBER)
Expand Down
27 changes: 25 additions & 2 deletions boingBallObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ OPT MODULE, OSVERSION=37
'intuition/imageclass',
'intuition/gadgetclass'

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

EXPORT ENUM BBGAD_NAME, BBGAD_LEFTEDGE, BBGAD_TOPEDGE,
EXPORT ENUM BBGAD_IDENT, BBGAD_LEFTEDGE, BBGAD_TOPEDGE,
BBGAD_WIDTH, BBGAD_HEIGHT, BBGAD_BGPEN, BBGAD_TRANSPARENT,
BBGAD_OK, BBGAD_CHILD, BBGAD_CANCEL

Expand Down Expand Up @@ -74,6 +74,18 @@ PROC create() OF boingBallSettingsForm
WINDOW_PARENTGROUP, VLayoutObject,
LAYOUT_SPACEOUTER, TRUE,
LAYOUT_DEFERLAYOUT, TRUE,

LAYOUT_ADDCHILD, self.gadgetList[ BBGAD_IDENT ]:=StringObject,
GA_ID, BBGAD_IDENT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,

CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Identifier',
LabelEnd,

LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,

Expand Down Expand Up @@ -216,12 +228,22 @@ PROC selectPen(nself,gadget,id,code) OF boingBallSettingsForm
self.clearBusy()
ENDPROC

EXPORT PROC canClose(modalRes) OF boingBallSettingsForm
DEF res
IF modalRes=MR_CANCEL THEN RETURN TRUE

IF checkIdent(self,self.boingBallObject,BBGAD_IDENT)=FALSE
RETURN FALSE
ENDIF
ENDPROC TRUE

PROC editSettings(comp:PTR TO boingBallObject) OF boingBallSettingsForm
DEF res

self.boingBallObject:=comp

self.tempBgPen:=comp.bgPen
SetGadgetAttrsA(self.gadgetList[ BBGAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[ BBGAD_LEFTEDGE ],0,0,[INTEGER_NUMBER,comp.leftEdge,0])
SetGadgetAttrsA(self.gadgetList[ BBGAD_TOPEDGE ],0,0,[INTEGER_NUMBER,comp.topEdge,0])
SetGadgetAttrsA(self.gadgetList[ BBGAD_WIDTH ],0,0,[INTEGER_NUMBER,comp.width,0])
Expand All @@ -230,6 +252,7 @@ PROC editSettings(comp:PTR TO boingBallObject) OF boingBallSettingsForm

res:=self.showModal()
IF res=MR_OK
AstrCopy(comp.ident,Gets(self.gadgetList[ BBGAD_IDENT ],STRINGA_TEXTVAL))
comp.leftEdge:=Gets(self.gadgetList[ BBGAD_LEFTEDGE ],INTEGER_NUMBER)
comp.topEdge:=Gets(self.gadgetList[ BBGAD_TOPEDGE ],INTEGER_NUMBER)
comp.width:=Gets(self.gadgetList[ BBGAD_WIDTH ],INTEGER_NUMBER)
Expand Down
27 changes: 25 additions & 2 deletions drawListObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ OPT MODULE, OSVERSION=37
'exec/nodes',
'amigalib/lists'

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

EXPORT ENUM DRAWLISTGAD_LIST,DRAWLISTGAD_ADD, DRAWLISTGAD_EDIT, DRAWLISTGAD_DEL,
EXPORT ENUM DRAWLISTGAD_IDENT, DRAWLISTGAD_LIST,DRAWLISTGAD_ADD, DRAWLISTGAD_EDIT, DRAWLISTGAD_DEL,
DRAWLISTGAD_OK, DRAWLISTGAD_CHILD, DRAWLISTGAD_CANCEL

CONST NUM_DRAWLIST_GADS=DRAWLISTGAD_CANCEL+1
Expand Down Expand Up @@ -329,6 +329,18 @@ PROC create() OF drawListSettingsForm
LAYOUT_SPACEOUTER, TRUE,
LAYOUT_DEFERLAYOUT, TRUE,


LAYOUT_ADDCHILD, self.gadgetList[ DRAWLISTGAD_IDENT ]:=StringObject,
GA_ID, DRAWLISTGAD_IDENT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,

CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Identifier',
LabelEnd,

LAYOUT_ADDCHILD,self.gadgetList[DRAWLISTGAD_LIST]:=ListBrowserObject,
GA_ID, DRAWLISTGAD_LIST,
GA_RELVERIFY, TRUE,
Expand Down Expand Up @@ -561,12 +573,22 @@ PROC createItemFromNode(node:PTR TO LONG) OF drawListSettingsForm
drawitem.pen:=Val(pen)
ENDPROC drawitem

EXPORT PROC canClose(modalRes) OF drawListSettingsForm
DEF res
IF modalRes=MR_CANCEL THEN RETURN TRUE

IF checkIdent(self,self.drawListObject,DRAWLISTGAD_IDENT)=FALSE
RETURN FALSE
ENDIF
ENDPROC TRUE

PROC editSettings(comp:PTR TO drawListObject) OF drawListSettingsForm
DEF res,i,n
DEF drawitem:PTR TO drawlist

self.drawListObject:=comp

SetGadgetAttrsA(self.gadgetList[ DRAWLISTGAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[DRAWLISTGAD_LIST],0,0,[LISTBROWSER_LABELS, Not(0), TAG_END])
FOR i:=0 TO comp.drawItemsList.count()-1
drawitem:=comp.drawItemsList.item(i)
Expand All @@ -578,6 +600,7 @@ PROC editSettings(comp:PTR TO drawListObject) OF drawListSettingsForm

res:=self.showModal()
IF res=MR_OK
AstrCopy(comp.ident,Gets(self.gadgetList[ DRAWLISTGAD_IDENT ],STRINGA_TEXTVAL))
FOR i:=0 TO comp.drawItemsList.count()-1
drawitem:=comp.drawItemsList.item(i)
END drawitem
Expand Down
27 changes: 24 additions & 3 deletions glyphObject.e
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ OPT MODULE, OSVERSION=37
'intuition/imageclass',
'intuition/gadgetclass'

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

EXPORT ENUM GLYGAD_NAME, GLYGAD_TYPE,
EXPORT ENUM GLYGAD_IDENT, GLYGAD_NAME, GLYGAD_TYPE,
GLYGAD_OK, GLYGAD_CHILD, GLYGAD_CANCEL


Expand Down Expand Up @@ -70,14 +70,24 @@ PROC create() OF glyphSettingsForm
LAYOUT_SPACEOUTER, TRUE,
LAYOUT_DEFERLAYOUT, TRUE,

LAYOUT_ADDCHILD, self.gadgetList[ GLYGAD_IDENT ]:=StringObject,
GA_ID, GLYGAD_IDENT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Identifier',
LabelEnd,

LAYOUT_ADDCHILD, self.gadgetList[ GLYGAD_NAME ]:=StringObject,
GA_ID, GLYGAD_NAME,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, '_Name',
LABEL_TEXT, '_Label',
LabelEnd,

LAYOUT_ADDCHILD, self.gadgetList[ GLYGAD_TYPE ]:=ChooserObject,
Expand Down Expand Up @@ -141,16 +151,27 @@ PROC end() OF glyphSettingsForm
END self.gadgetActions[NUM_GLY_GADS]
ENDPROC

EXPORT PROC canClose(modalRes) OF glyphSettingsForm
DEF res
IF modalRes=MR_CANCEL THEN RETURN TRUE

IF checkIdent(self,self.glyphObject,GLYGAD_IDENT)=FALSE
RETURN FALSE
ENDIF
ENDPROC TRUE

PROC editSettings(comp:PTR TO glyphObject) OF glyphSettingsForm
DEF res

self.glyphObject:=comp

SetGadgetAttrsA(self.gadgetList[ GLYGAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[ GLYGAD_NAME ],0,0,[STRINGA_TEXTVAL,comp.name,0])
SetGadgetAttrsA(self.gadgetList[ GLYGAD_TYPE ],0,0,[CHOOSER_SELECTED,comp.glyphType,0])

res:=self.showModal()
IF res=MR_OK
AstrCopy(comp.ident,Gets(self.gadgetList[ GLYGAD_IDENT ],STRINGA_TEXTVAL))
AstrCopy(comp.name,Gets(self.gadgetList[ GLYGAD_NAME ],STRINGA_TEXTVAL))
comp.glyphType:=Gets(self.gadgetList[ GLYGAD_TYPE ],CHOOSER_SELECTED)
ENDIF
Expand Down
Loading

0 comments on commit 5db6953

Please sign in to comment.