Now we can colouring all dialogs with different colors (CLR_WHITE,CLR_GREEN,...) or gradient-brushes in the format {{},{},...},... or file-brushes (test1.bmp,test2.jpg,...) . If only one is defined, all the dialogs are with same color or brush.
1. New method SetDiaColors to coloring the dialogs from folder
- Code: Select all Expand view RUN
- METHOD SetDiaColors( oDlg , n ) CLASS TFolderEx
local oBrush
if Len( ::aClrDialogs ) >= n .and. (valtype(::aClrDialogs[n]) == "N" .or. valtype(::aClrDialogs[n]) == "A" .or. (valtype(::aClrDialogs[n]) == "C" .and. file(rtrim(::aClrDialogs[n])) ) )
if valtype(::aClrDialogs[n]) == "N"
oBrush = TBrush():New( , ::aClrDialogs[ n ] ) //simple color
elseif valtype(::aClrDialogs[n]) == "A"
oBrush := TBrush():New(,,,,::aClrDialogs[n]) //array with gradient
else
oBrush := TBrush():New( , ,rtrim(::aClrDialogs[ n ]) ) //picture-file
endif
oDlg:SetBrush( oBrush )
else
if oDlg:lTransparent
if ::oWnd:oBrush != NIL
oDlg:SetBrush( ::oWnd:oBrush )
else
oBrush = TBrush():New( , ::oWnd:nClrPane )
oDlg:SetBrush( oBrush )
endif
else
oBrush = TBrush():New( , CLR_WHITE )
oDlg:SetBrush( oBrush )
endif
endif
if hb_isObject( oBrush )
oBrush:end()
endif
RETURN NIL
2. In method Default()
- Code: Select all Expand view RUN
- ::SetDiaColors( oDlg , nAkt ) //NEW!
ACTIVATE DIALOG oDlg NOWAIT VALID .f.;
ON INIT ::Move( aMove[ 1 ], aMove[ 2 ] )
3. New Header
- Code: Select all Expand view RUN
- #xcommand @ <nRow>, <nCol> FOLDEREX [<oFolder>] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
[ <bm: BITMAPS, IMAGES, BMPS> <cbmps,...> ] ;
[ <lPixel: PIXEL> ] ;
[ <lDesign: DESIGN> ] ;
[ TAB HEIGHT <ntabheight> ];
[ SEPARATOR <nSep> ];
[ OPTION <nOption> ] ;
[ ROUND <nRound> ];
[ SIZE <nWidth>, <nHeight> ] ;
[ <lAdjust: ADJUST> ] ;
[ <lStretch: STRETCH> ] ;
[ POPUP <upop>];
[ ALIGN <nAlign,...> ] ;
[ ACTION <uAction> ];
[ BRIGHT <nBright> ] ;
[ ON CHANGE <uChange> ] ;
[ ON PAINT TAB <uPaint> ];
[ ON PAINT TEXT <uPaintxt> ];
[ HELPTOPICS <cnHelpids,...> ] ;
[ <layout: TOP, LEFT, BOTTOM, RIGHT> ] ;
[ <lAnimate: ANIMATE> [ SPEED <nSpeed> ] ] ;
[ FONT <oFont> ] ; //-->> byte-one 2010
[ <lTransparent: TRANSPARENT> ] ;
[ DIALOGCOLORS <nColors,...> ] ; //-->> byte-one 2011
=> ;
[<oFolder> := ] TFoldereX():New( <nRow>, <nCol>, <nWidth>, <nHeight>,;
<oWnd>, [\{<cbmps>\}], <.lPixel.>, <.lDesign.>, [\{<cPrompt>\}], ;
<ntabheight>, [\{<cnHelpids>\}], <nRound>, [{|nOption, nOldOption, Self | <uChange>}],;
[{|Self,nOption| <uPaint>}], [{|Self,nOption| <uPaintxt>}], ;
[\{<nAlign>\}], <.lAdjust.>, <nSep>, <nOption>, [{|Self,nOption| <upop>}],;
<.lStretch.>, [ Upper(<(layout)>) ], [{|Self,nOption| <uAction>}], <nBright>, <.lAnimate.>, [<nSpeed>],;
<oFont>,<.lTransparent.>,[\{<nColors>\}])
#xcommand REDEFINE FOLDEREX [<oFolder>];
[ ID <nId> ] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
[ <bm: BITMAPS, IMAGES, BMPS> <cbmps,...> ] ;
[ <dlg: DIALOG, DIALOGS, PAGE, PAGES> <cDlgsName,...> ] ;
[ TAB HEIGHT <ntabheight> ];
[ OPTION <nOption> ] ;
[ ROUND <nRound> ];
[ SEPARATOR <nSep> ];
[ <lAdjust: ADJUST> ] ;
[ <lStretch: STRETCH> ] ;
[ POPUP <upop>];
[ ALIGN <nAlign,...> ] ;
[ BRIGHT <nBright> ] ;
[ ACTION <uAction> ];
[ ON CHANGE <uChange> ] ;
[ ON PAINT TAB <uPaint> ];
[ ON PAINT TEXT <uPaintxt> ];
[ HELPTOPICS <cnHelpids,...> ] ;
[ <layout: TOP, LEFT, BOTTOM, RIGHT> ] ;
[ <lAnimate: ANIMATE> [ SPEED <nSpeed> ] ] ;
[ FONT <oFont> ]; //-->> byte-one 2010
[ <lTransparent: TRANSPARENT> ] ;
[ DIALOGCOLORS <nColors,...> ] ; //-->> byte-one 2011
=> ;
[<oFolder> := ] TFoldereX():ReDefine( <nId>, <oWnd>, [\{<cDlgsName>\}],;
[\{<cbmps>\}], [\{<cPrompt>\}], <ntabheight>, [\{<cnHelpids>\}],;
<nRound>, [{|nOption,nOldOption,Self| <uChange>}],;
[{|Self,nOption| <uPaint>}], [{|Self,nOption| <uPaintxt>}], ;
[\{<nAlign>\}], <.lAdjust.>, <nSep>, <nOption>, ;
[{|Self,nOption| <upop>}], <.lStretch.>, [ Upper(<(layout)>) ],;
[{|Self,nOption| <uAction>}], <nBright>, <.lAnimate.>, [<nSpeed>],;
<oFont>,<.lTransparent.>,[\{<nColors>\}] )