Antonio Linares wrote:Have you tried oCheckBox:SetColor( nClrForeground, nClrBackground ) ?
COLOR BFcolor, BGcolor
FUNCTION CTRLS_COLORS(f_oDlgContainer)
Local lc_aCtrls := {}, lc_iFor := 0
Local lc_aItemsRadio := {}
lc_aCtrls := f_oDlgContainer:aControls
For lc_iFor := 1 To Len(lc_aCtrls)
If ValType(lc_aCtrls[lc_iFor]) == "O"
if lc_aCtrls[lc_iFor]:ClassName() == "TRADIO"
aEval(lc_aCtrls[lc_iFor]:oRadMenu:aItems,;
{|_oRadId|{SetWindowTheme(_oRadId:hWnd, "", "" ),;
_oRadId:SetColor(CLR_WHITE,nRgb(111,141,160))}})
ElseIf lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"
SetWindowTheme(lc_aCtrls[lc_iFor]:hWnd, "", "" )
lc_aCtrls[lc_iFor]:SetColor(CLR_WHITE,nRgb(111,141,160))
EndIf
EndIf
Next
RETURN NIL
// C:\FWH\SAMPLES\SILVPREV.PRG - Example By Silvio Falconi.
#include "FiveWin.ch"
#include "constant.ch"
#define AS_MDICHILD 1
#define AS_DIALOG 2
STATIC oWnd
FUNCTION Main()
DEFINE WINDOW oWnd TITLE "Test" MDI MENU BuildMenu()
SET MESSAGE OF oWnd TO "test" CENTER NOINSET 2015
ACTIVATE WINDOW oWnd
RETURN NIL
FUNCTION BuildMenu()
LOCAL oMenu
MENU oMenu 2015
MENUITEM "Test"
MENU
MENUITEM "test" ACTION Previsioni()
ENDMENU
oMenu:AddMdi()
ENDMENU
RETURN( oMenu )
FUNCTION Previsioni()
LOCAL oDlg, oBar, oFont, oBrw, N
LOCAL nBottom := 44
LOCAL nRight := 110
LOCAL nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
LOCAL nHeight := nBottom * DLG_CHARPIX_H
LOCAL nClrText := CLR_BLACK
LOCAL oGrp := Array( 2 )
LOCAL cTitle := "Previsioni"
LOCAL oProgress
LOCAL oPrevisione
LOCAL dprimadata, ntotali_records, primo
LOCAL oItem1, oItem2
LOCAL aData := {}
LOCAL oPanel
LOCAL aValues := Array( 12 )
LOCAL aGetChk := Array( 12 )
LOCAL aGet := Array( 20 )
LOCAL aRuote := { "Bari", "Cagliari", "Firenze", "Genova", ;
"Milano", "Napoli", "Palermo", "Roma", "Torino", ;
"Venezia", "Nazionale", "Tutte" }
DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -14 BOLD
DEFINE DIALOG oDlg TITLE "test" SIZE nWidth, nHeight PIXEL ;
COLOR CLR_BLACK, CLR_WHITE RESIZABLE FONT oFont TRANSPARENT
oDlg:lHelpIcon := .F.
DEFINE BUTTONBAR oBar BUTTONSIZE 60, 30 _3DLOOK TOP OF oDlg 2015 NOBORDER
oBar:SetFont( oFont )
oBar:nClrText := CLR_HBLUE
oBar:Adjust()
DEFINE BUTTON OF oBar FILENAME "bitmaps\elabora.bmp" ;
PROMPT " Elabora " LEFT ACTION Elabora() GROUP
DEFINE BUTTON OF oBar FILENAME "bitmaps\salva.bmp" ;
PROMPT " Salva " LEFT ACTION Salva() GROUP
DEFINE BUTTON OF oBar FILENAME "bitmaps\stampa.bmp" ;
PROMPT " Stampa " LEFT ACTION Stampa() GROUP
@ 20, 140 XBROWSE oBrw PIXEL OF oDlg ;
DATASOURCE aData AUTOCOLS CELL LINES NOBORDER FASTEDIT
SetupBrowsePrevisioni( oBrw )
oBrw:CreateFromCode()
oPanel = TScrollPanel():New( 40, 5, oBrw:nHeight - 200, oBrw:nLeft - 5, oDlg )
oPanel:WinStyle( WS_BORDER, .F. )
oDlg:bResized := < ||
LOCAL oRect := oDlg:GetCliRect()
oBar:nWidth := oRect:nRight
oBrw:nWidth := oRect:nRight - 290
oBrw:nHeight := oRect:nBottom - 45
oPanel:nTop := oRect:ntop + 40
oPanel:nLeft := oRect:nleft + 5
oPanel:nBottom := oBrw:nHeight - 200
oBar:refresh()
FOR n = 1 TO Len( oPanel:aControls )
oPanel:aControls[ n ]:Refresh()
NEXT
RETURN NIL
>
ACTIVATE DIALOG oDlg AS MDICHILD ;
ON INIT ( CreateOption( oPanel, @aGet, @aValues, aRuote, @aGetChk ), ;
oPanel:SetRange(), Eval( oDlg:bResized ) )
oFont:End()
RETURN NIL
FUNCTION CreatePanel( oDlg, oBrw, oPanel )
oPanel = TScrollPanel():New( 40, 5, oDlg:nBottom - 60, oBrw:nLeft - 5, oDlg )
oPanel:WinStyle( WS_BORDER, .F. )
RETURN oPanel
FUNCTION CreateOption( oPanel, aGet, aValues, aRuote, aGetChk )
LOCAL nTop := 2
LOCAL nCol := 5
LOCAL nCol2 := 20
LOCAL nSizew := 100
LOCAL nSizeh := 18
LOCAL oGrp, nChk := 0
AFill( aValues, .F. )
oPanel:AddText( 5, nCol, 100, 18, "Ruote attive", ,, .T., 0xC38B2B, , 1 )
@ nTop, ncol CHECKBOX aGetChk[ 1 ] VAR aValues[ 1 ] ;
PROMPT aRuote[ 1 ] SIZE nSizew, nSizeh OF oPanel ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY // SCROLL ADJUST
@ nTop += 1.7, ncol CHECKBOX aGetChk[ 2 ] VAR aValues[ 2 ] ;
PROMPT aRuote[ 2 ] SIZE nSizew, nSizeh OF oPanel ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY // SCROLL ADJUST
@ nTop += 1.7, ncol CHECKBOX aGetChk[ 3 ] VAR aValues[ 3 ] ;
PROMPT aRuote[ 3 ] SIZE nSizew, nSizeh OF oPanel ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY // SCROLL ADJUST
@ nTop += 1.7, ncol CHECKBOX aGetChk[ 4 ] VAR aValues[ 4 ] ;
PROMPT aRuote[ 4 ] SIZE nSizew, nSizeh OF oPanel ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY // SCROLL ADJUST
@ nTop += 1.7, ncol CHECKBOX aGetChk[ 5 ] VAR aValues[ 5 ] ;
PROMPT aRuote[ 5 ] SIZE nSizew, nSizeh OF oPanel ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY // SCROLL ADJUST
@ nTop += 1.7, ncol CHECKBOX aGetChk[ 6 ] VAR aValues[ 6 ] ;
PROMPT aRuote[ 6 ] SIZE nSizew, nSizeh OF oPanel ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY // SCROLL ADJUST
nTop := 2
@ nTop, ncol2 CHECKBOX aGetChk[ 7 ] VAR aValues[ 7 ] ;
PROMPT aRuote[ 7 ] SIZE nSizew, nSizeh OF oPanel ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY // SCROLL ADJUST
@ nTop += 1.7, ncol2 CHECKBOX aGetChk[ 8 ] VAR aValues[ 8 ] ;
PROMPT aRuote[ 8 ] SIZE nSizew, nSizeh OF oPanel ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY // SCROLL ADJUST
@ nTop += 1.7, ncol2 CHECKBOX aGetChk[ 9 ] VAR aValues[ 9 ] ;
PROMPT aRuote[ 9 ] SIZE nSizew, nSizeh OF oPanel ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY // SCROLL ADJUST
@ nTop += 1.7, ncol2 CHECKBOX aGetChk[ 10 ] VAR aValues[ 10 ] ;
PROMPT aRuote[ 10 ] SIZE nSizew, nSizeh OF oPanel ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY // SCROLL ADJUST
@ nTop += 1.7, ncol2 CHECKBOX aGetChk[ 11 ] VAR aValues[ 11 ] ;
PROMPT aRuote[ 11 ] SIZE nSizew, nSizeh OF oPanel ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY // SCROLL ADJUST
@ nTop += 1.7, ncol2 CHECKBOX aGetChk[ 12 ] VAR aValues[ 12 ] ;
PROMPT aRuote[ 12 ] SIZE nSizew, nSizeh OF oPanel ;
ON CHANGE ( Select_All( aGetChk, aValues[ 12 ] ) ) ;
UPDATE COLOR CLR_GRAY, CLR_HGRAY
RETURN NIL
FUNCTION Elabora()
MsgInfo( "elabora" )
RETURN NIL
FUNCTION Salva()
MsgInfo( "salva" )
RETURN NIL
FUNCTION stampa()
MsgInfo( "stampa" )
RETURN NIL
STATIC FUNCTION Select_All( aGet, lValue )
LOCAL n
FOR n = 1 TO Len( aGet )
aGet[ n ]:SetCheck( lValue )
NEXT
RETURN NIL
STATIC FUNCTION SetupBrowsePrevisioni( oBrw )
WITH OBJECT oBrw
AEval( :aCols, {| o, i | o:cHeader := LTrim( Str( i, 2 ) ) } )
:nEditTypes := EDIT_GET
:nWidths := 24
:lDrawBorder := .T.
:lHscroll := .T.
:lVscroll := .T.
:l2007 := .F.
:l2015 := .F.
:lAllowRowSizing := .F.
:lAllowColSwapping := .F.
:lAllowColHiding := .F.
// NEW
:lAllowSizings := .F.
:lAutoSaves := .T.
:lColDividerComplete := .F.
:nClrBorder := CLR_GRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:bRecSelHeader := {|| " " }
:SetStyle( 2018 )
END
RETURN NIL
// FIN / END
#include "fivewin.ch"
function Main()
local oWnd, oBtn, oCbx
local lCheck := .f.
DEFINE WINDOW oWnd COLOR CLR_WHITE, CLR_BLACK ;
TITLE "DARK THEME WINDOW"
@ 20,20 SAY "DARK WINDOW " + If( IsAppThemed(), "THEMED", "NON-THEMED" ) ;
SIZE 200,24 PIXEL OF oWnd
@ 60,20 CHECKBOX oCbx VAR lCheck PROMPT "Check Box-01" SIZE 100,25 PIXEL OF oWnd ;
COLOR CLR_HRED, CLR_YELLOW
@ 150,20 BUTTON oBtn PROMPT "BUTTON" SIZE 100,40 PIXEL OF oWnd
ACTIVATE WINDOW oWnd CENTERED
return nil
#ifndef __64__
1 24 "WinXP/WindowsXP.Manifest"
#else
1 24 "WinXP/WindowsXP.Manifest64"
#endif
karinha wrote:Please post the code for testing.
Regards, saludos.
PRIVATE BGcolor := RGB( 001, 001, 001 ) // CLR_BLACK
PRIVATE BFcolor := RGB( 025, 254, 255 ) // CLR_CYAN
DEFINE WINDOW oWnd FROM 0, 0 TO 290, 300 PIXEL TITLE "File attributes for " + cFile ICON "A1MAIN" NOMINIMIZE NOMAXIMIZE COLOR BFcolor, BGcolor
@ 026, 14 CHECKBOX oFA_Check_1 VAR lArchive PROMPT "&Archive" SIZE 180, 16 PIXEL FONT oFontDefault OF oWnd
@ 048, 14 CHECKBOX oFA_Check_2 VAR lReadOnly PROMPT "&Read only" SIZE 180, 16 PIXEL FONT oFontDefault OF oWnd
@ 070, 14 CHECKBOX oFA_Check_3 VAR lHidden PROMPT "&Hidden" SIZE 180, 16 PIXEL FONT oFontDefault OF oWnd
@ 092, 14 CHECKBOX oFA_Check_4 VAR lSystem PROMPT "&System" SIZE 180, 16 PIXEL FONT oFontDefault OF oWnd
@ 130, 14 CHECKBOX oFA_Check_5 VAR lChange PROMPT "Change &date/time" SIZE 180, 16 PIXEL FONT oFontDefault OF oWnd
oFA_Check_1:SetColor( BGcolor, BFcolor )
oFA_Check_2:SetColor( BGcolor, BFcolor )
oFA_Check_3:SetColor( BGcolor, BFcolor )
oFA_Check_4:SetColor( BGcolor, BFcolor )
oFA_Check_5:SetColor( BGcolor, BFcolor )
@ 110, 206 BUTTON oFA_Button_3 PROMPT "C&urrent" SIZE 74, 42 PIXEL FONT oFontDefault ;
ACTION( cDate := DTOC( DATE() ), oFA_Text_1:refresh(), ;
cTime := TIME(), oFA_Text_2:refresh(), ;
lChange := .t., oFA_Check_5:refresh() )
@ 160, 014 GET oFA_Text_1 VAR cDate SIZE 120, 28 PIXEL FONT oFontDefault COLOR BFcolor, BGcolor OF oWnd
@ 160, 182 GET oFA_Text_2 VAR cTime SIZE 100, 28 PIXEL FONT oFontDefault COLOR BFcolor, BGcolor OF oWnd
@ 202, 014 BUTTON oFA_Button_2 PROMPT "&Cancel" SIZE 80, 42 PIXEL FONT oFontDefault ACTION oWnd:End()
@ 202, 206 BUTTON oFA_Button_1 PROMPT "&Ok" SIZE 74, 42 PIXEL FONT oFontDefault ACTION( SetAttr( cPath + cFile, lArchive, lReadOnly, lHidden, lSystem, lChange, cDate, cTime ), oWnd:End() )
#IFDEF __HMG__
END WINDOW
#ENDIF
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 81 guests