FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Show boxes color on a dialog
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Show boxes color on a dialog

Posted: Tue May 12, 2015 03:34 PM
Look this picture pls




I wish show two boxes color : when the user select color1 button ( with choosecolor function) it must colorize the box
I tried with say,get and btnbmp but I not Know how make it

I made : ( but not run ok )

@ 108,5 SAY "Colore1 :" SIZE 30, 10 PIXEL OF o:aDialogs[2]
@ 108, 30 GET o:aColor[1] VAR o:cColor1 OF o:aDialogs[2] SIZE 20, 10 PIXEL COLOR o:cColor1,o:cColor1 READONLY
@ 108, 55 BUTTON oBtnSel[1] PROMPT ".." SIZE 10, 10 PIXEL ;
OF o:aDialogs[2] ACTION (o:=ChooseColor(o:cColor1), o:aColor[1]:SetColor(o:cColor1,o:cColor1),;
o:aColor[1]:Refresh(), sysrefresh() )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM

Re: Show boxes color on a dialog

Posted: Tue May 12, 2015 04:49 PM

Silvio
In EasyReport source is an example

viewtopic.php?f=31t=29070hilit=easyreportstart=45#p165270

&&&

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: Show boxes color on a dialog

Posted: Wed May 13, 2015 07:18 AM

file ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: Show boxes color on a dialog

Posted: Wed May 13, 2015 07:28 AM

I found it
I made the same ...

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: Show boxes color on a dialog

Posted: Wed May 13, 2015 04:52 PM
Silvio,

does Your problem still exist ?

my solution :

changing a border with defined linesize and color on
buttonaction, focus or lostfocus adjusted to any control or defined free size and position.



best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: Show boxes color on a dialog

Posted: Thu May 14, 2015 08:05 AM
Uwe,

yes also exist.

I made a small class to set xbrowse option

and I need to select color to make zebra effect




Now I use get control but it not run ok
If use READONLY CLAUSOLE then not run
the final user can put the mouse into and it is no correct
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Show boxes color on a dialog

Posted: Thu May 14, 2015 08:24 AM

Silvio,

use TSay intstead of TGet.

EMG

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: Show boxes color on a dialog

Posted: Thu May 14, 2015 09:21 AM
Silvio,

I added a xbrowse-config-solution to my new appl.

there are still some more colors to be defined ( 6 ), like my 2. screenshot shows.

the defined xBrowse-config-button



defined ( realtime preview on color-selection )

1. zebra-color 1
2. zebra-text-color 1 // neded to use dark row-colors
3. zebra-color 2
4. zebra-text-color 2 // neded to use dark row-colors
5. zebra-focus-color
6. zebra-focus-text-color // neded to use dark row-colors


7. folder background



color-selecting sample of 1. zebra-color

Code (fw): Select all Collapse
//aVal[100] := ("SYSTEM")->nBRColorF1   
//aVal[101] := ("SYSTEM")->nBRColorT1   
//aVal[102] := ("SYSTEM")->nBRColorF2   
//aVal[103] := ("SYSTEM")->nBRColorT2   
//aVal[104] := ("SYSTEM")->nBRColorF3   
//aVal[105] := ("SYSTEM")->nBRColorT3   
//aVal[106] := ("SYSTEM")->nDFolder 

aDat1:= { {"Zeile1-Spalte1","Zeile1-Spalte2"},; 
{"Zeile2-Spalte1","Zeile2-Spalte2"},; 
{"Zeile3-Spalte1","Zeile3-Spalte2"},; 
{"Zeile4-Spalte1","Zeile4-Spalte2"},; 
{"Zeile5-Spalte1","Zeile5-Spalte2"},; 
{"Zeile6-Spalte1","Zeile6-Spalte2"},; 
{"Zeile7-Spalte1","Zeile7-Spalte2"},; 
{"Zeile8-Spalte1","Zeile8-Spalte2"},; 
{"Zeile9-Spalte1","Zeile9-Spalte2"},; 
{"Zeile10-Spalte1","Zeile10-Spalte2"},;                
{"Zeile11-Spalte1","Zeile11-Spalte2"},; 
{"Zeile12-Spalte1","Zeile12-Spalte2"},; 
{"Zeile13-Spalte1","Zeile13-Spalte2"},; 
{"Zeile14-Spalte1","Zeile14-Spalte2"},; 
{"Zeile15-Spalte1","Zeile15-Spalte2"},; 
{"Zeile16-Spalte1","Zeile16-Spalte2"} } 

REDEFINE XBROWSE oBrw ID 110 OF oDlg4 ARRAY aDat1 AUTOCOLS FONT oFontTiny
SHOW_XBRW( oBrw, aVal )
oBrw:Refresh()

// ---- select ZEBRA-row-color 1 ------

REDEFINE BITMAP oBBmp[1] FILENAME NIL OF oDlg4 ;
ID 210 PIXEL  ADJUST BORDER
oBBmp[1]:cTooltip := { "Rowcolor 1","Selected", 1, CLR_BLACK, 14089979 }
oBBmp[1]:bPainted := { |hDC| DRAW_COL( oBBmp[1], hDC, aVal[100] ) }

REDEFINE BTNBMP oBtn[1] OF oDlg4 ;
ID 220 PIXEL 2007 ;
NOBORDER ;
PROMPT "&a) Listenzeile 1" ;
FILENAME c_Pfad1 + "Paint1.Bmp" ;
ACTION ( aVal[100] := ChooseColor(), oBBmp[1]:Refresh(), ;
                  SHOW_XBRW( oBrw, aVal ), oBrw:Refresh() ) ;
FONT oFontSys  ;
TOP
oBtn[1]:bClrGrad := { | lMouseOver | If( ! lMouseOver,;
        { { nBGradPos1, nBColorF1, nBColorB1 }, ;
        { nBGradPos1, nBColorB1, nBColorF1 } }, ;
        { { nBGradPos2, nBColorF2, nBColorB2 }, ;
        { nBGradPos2, nBColorB2, nBColorF2 } } ) }
oBtn[1]:lTransparent := .t.   
oBtn[1]:cToolTip =  { "xBrowse-Row 1","Color-selection", 1, CLR_BLACK, 14089979 }
oBtn[1]:SetColor( 0, )  

....
....

// ------------------------------

FUNCTION SHOW_XBRW( oBrw, aVal )

oBrw:nMarqueeStyle  := MARQSTYLE_HIGHLROW
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:bClrStd := { || If( oBrw:KeyNo() % 2 == 0, ;
   { If( ( oBrw:cAlias )->( Deleted() ), 255, aVal[103] ), aVal[102] }, ;
   { If( ( oBrw:cAlias )->( Deleted() ), 255, aVal[101] ), aVal[100] } ) }
oBrw:bClrSel            :=  ;
oBrw:bClrSelFocus := { || { If( ( oBrw:cAlias )->( Deleted() ), 255, aVal[105] ), aVal[104] } }
oBrw:nRecSelColor := 15512898 
oBrw:lHScroll := .T.
oBrw:lVScroll := .T.
oBrw:lFooter := .T.
oBrw:nRowHeight := 25
oBrw:oFont := oFontSys
//oBrw1:lResizeCols := .F.

RETURN NIL

//------------- BMP-Color -----------

FUNCTION DRAW_COL( oBitmap, hDC, nColor ) 
LOCAL oBrush
LOCAL aRect := GETCLIENTRECT( oBitmap:hWnd )

DEFINE BRUSH oBrush COLOR nColor
FillRect( oBitmap:hDC, aRect, oBrush:hBrush )
oBrush:End()

RETURN( NIL )


best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: Show boxes color on a dialog

Posted: Sat May 16, 2015 12:30 PM

viewtopic.php?f=3t=30711

best regards
Uwe :)

&

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: Show boxes color on a dialog

Posted: Wed May 20, 2015 07:15 AM

I'm sorry but this is not what I was looking for. my aim is to create a small configuration for xbrowse, each configuration can be inserted into any table and changed by the end user in an extremely simple, the configuration stored in an .ini file can ' be called to the creation of the table xbrowse. I have spoken of zebra but I was referring to an xbrowse amendment made ​​by Mastintin ( Manuel) that works very well. But that was not my problem : my problem was to show squares with customizable color and nothing else...You sir went further than what I was asking for help!!!!

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion