Skip to content

Instantly share code, notes, and snippets.

@MarkGoldberg
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarkGoldberg/ec718a1d8032636d87fb to your computer and use it in GitHub Desktop.
Save MarkGoldberg/ec718a1d8032636d87fb to your computer and use it in GitHub Desktop.
CorrectControls
!Below is a simplified version of code that I call after opening every window
MOD:LineHeight LONG(9)
CorrectControls PROCEDURE(*Window xWin)
CurrFEQ SIGNED !No Auto
IsFrame BOOL,AUTO
CODE
IsFrame = CHOOSE( xWin{PROP:Type} = CREATE:application )
LOOP
CurrFEQ = xWin{PROP:NextField, CurrFEQ}
IF CurrFEQ > 0 OR (IsFrame AND CurrFEQ <> 0)
DO CorrectControls:MakeTransparentForManifest
DO CorrectControls:General
ELSIF ~CurrFEQ
BREAK
END
END
CorrectControls:MakeTransparentForManifest ROUTINE ! side-effect xWin & CurrFEQ
CASE xWin$CurrFEQ{PROP:Type}
OF CREATE:Button !TRN, turns off manifest look
OROF CREATE:radio !TRN, turns off manifest look, when has ICO
OROF CREATE:check !TRN, turns off manifest look, when has ICO
OROF CREATE:Entry
OROF CREATE:Spin
OROF CREATE:Combo
OROF CREATE:Text
OROF CREATE:List
OROF CREATE:Sheet
OROF CREATE:Tab ; !avoid else (do nothing)
OF CREATE:DropList ; xWin$CurrFEQ {PROP:Trn} = TRUE
xWin$(xWin$CurrFEQ{PROP:ListFEQ}){PROP:Trn} = TRUE
! OF CREATE:option
! OROF CREATE:group
! OROF CREATE:string
! OROF CREATE:prompt
! OROF CREATE:sstring
ELSE
xWin$CurrFEQ{PROP:Trn} = TRUE
END
CorrectControls:General ROUTINE ! side-effect xWin & CurrFEQ & MOD:LineHeight
CASE xWin$CurrFEQ{PROP:Type}
OF CREATE:Sheet ; xWin$CurrFEQ{PROP:NoTheme} = TRUE
xWin$CurrFEQ{PROP:TabSheetStyle} = TabStyle:BlackAndWhite !<-- see Equates.clw
OROF CREATE:Tab ; xWin$CurrFEQ{PROP:FontColor} = COLOR:Black
OF CREATE:SPIN ; IF INSTRING('N',UPPER(xWin$CurrFEQ{PROP:Text}),1,1)
xWin$CurrFEQ{PROP:Ins} = TRUE
END
OF CREATE:List ; xWin$CurrFEQ{PROP:LineHeight} = MOD:LineHeight !<-- value set elsewhere...
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment