Copy and paste this code to a form to execute a sample application that invokes the Color Dialog. The form must be enabled for full RDLMX.
*
*
* COMPONENT: STD_FORM
*
*
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) CLIENTHEIGHT(459) CLIENTWIDTH(239) HEIGHT(486) LEFT(545) TOP(171) WIDTH(247)
Define_Com Class(#PRIM_LABL) Name(#InitialValuesLbl) CAPTION('Color dialog Inital values') DISPLAYPOSITION(5) HEIGHT(20) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(5) TABSTOP(False) TOP(8) WIDTH(137)
Define_Com Class(#PRIM_LABL) Name(#InitialColorLbl) CAPTION('Initial Color') DISPLAYPOSITION(4) HEIGHT(20) LEFT(24) PARENT(#COM_OWNER) TABPOSITION(4) TABSTOP(False) TOP(32) WIDTH(81)
Define_Com Class(#PRIM_EDIT) Name(#InitialColor) DISPLAYPOSITION(2) LEFT(112) PARENT(#COM_OWNER) SHOWSELECTION(False) SHOWSELECTIONHILIGHT(False) TABPOSITION(2) TOP(32) WIDTH(73)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_1) CAPTION('Start Color Dialog') DISPLAYPOSITION(1) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(1) TOP(136) WIDTH(161)
Define_Com Class(#PRIM_APPL.ICommonDialogColor) Name(#colorDlg) Reference(*DYNAMIC)
Define_Com Class(#PRIM_LABL) Name(#ResultLbl) CAPTION('Color dialog results') DISPLAYPOSITION(6) HEIGHT(20) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(6) TABSTOP(False) TOP(176) WIDTH(105)
Define_Com Class(#PRIM_LABL) Name(#ResultColorLbl) CAPTION('Result Color') DISPLAYPOSITION(3) HEIGHT(20) LEFT(32) PARENT(#COM_OWNER) TABPOSITION(3) TABSTOP(False) TOP(200) WIDTH(65)
Define_Com Class(#PRIM_PHBN) Name(#GotoOpenFileForm) CAPTION('Goto Open File Dialog form') DISPLAYPOSITION(7) LEFT(24) PARENT(#COM_OWNER) TABPOSITION(7) TOP(424) WIDTH(185)
Define_Com Class(#PRIM_EDIT) Name(#ResultColor) DISPLAYPOSITION(8) LEFT(112) PARENT(#COM_OWNER) SHOWSELECTION(False) SHOWSELECTIONHILIGHT(False) TABPOSITION(8) TOP(200) WIDTH(73)
Define_Com Class(#PRIM_GPBX) Name(#GPBX_1) DISPLAYPOSITION(9) HEIGHT(81) LEFT(32) PARENT(#COM_OWNER) TABPOSITION(9) TABSTOP(False) TOP(240) WIDTH(193)
Define_Com Class(#PRIM_RDBN) Name(#OkButtonPressed) CAPTION('OK Button pressed') DISPLAYPOSITION(1) LEFT(16) PARENT(#GPBX_1) TABPOSITION(1) TOP(16)
Define_Com Class(#PRIM_RDBN) Name(#CancelButtonPressed) CAPTION('Cancel Button pressed') DISPLAYPOSITION(2) LEFT(16) PARENT(#GPBX_1) TABPOSITION(2) TOP(48) WIDTH(153)
Define_Com Class(#PRIM_CKBX) Name(#FullDetailsMode) CAPTION('Full Details Mode') DISPLAYPOSITION(10) LEFT(24) PARENT(#COM_OWNER) TABPOSITION(10) TOP(66)
Define_Com Class(#AAOPENFIL) Name(#OpenFileDlgForm)
Evtroutine Handling(#com_owner.Initialize)
Set Com(#com_owner) CAPTION(*component_desc)
Endroutine
Evtroutine Handling(#PHBN_1.Click)
Invoke Method(#sys_appln.CreateColorDialog) RESULT(#COLORDLG)
Define Field(#boolRes) Type(*BOOLEAN)
#COLORDLG.ChosenColor := green
If (#FULLDETAILSMODE.ButtonState = checked)
#COLORDLG.FullyOpen := true
Else
#COLORDLG.FullyOpen := false
Endif
Invoke Method(#COLORDLG.Show) OKPRESSED(#boolRes) FORMOWNER(#com_self)
If (#BOOLRES)
#OKBUTTONPRESSED.ButtonChecked := true
#CANCELBUTTONPRESSED.ButtonChecked := false
#RESULTCOLOR.Value := #COLORDLG.ChosenColor
Else
#CANCELBUTTONPRESSED.ButtonChecked := true
#okbUTTONPRESSED.ButtonChecked := false
#RESULTCOLOR.Value := ''
Endif
Endroutine
Evtroutine Handling(#GotoOpenFileForm.Click)
Invoke Method(#OPENFILEDLGFORM.ShowForm)
Endroutine
End_Com