Show boxes color on a dialog

Show boxes color on a dialog

Postby Silvio.Falconi » Tue May 12, 2015 3:34 pm

Look this picture pls

Image


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:oFld:aDialogs[2]
@ 108, 30 GET o:aColor[1] VAR o:cColor1 OF o:oFld:aDialogs[2] SIZE 20, 10 PIXEL COLOR o:cColor1,o:cColor1 READONLY
@ 108, 55 BUTTON oBtnSel[1] PROMPT ".." SIZE 10, 10 PIXEL ;
OF o:oFld:aDialogs[2] ACTION (o:cColor1:=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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6920
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show boxes color on a dialog

Postby cnavarro » Tue May 12, 2015 4:49 pm

Silvio
In EasyReport source is an example

viewtopic.php?f=31&t=29070&hilit=easyreport&start=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
User avatar
cnavarro
 
Posts: 6525
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Show boxes color on a dialog

Postby Silvio.Falconi » Wed May 13, 2015 7:18 am

file ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6920
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show boxes color on a dialog

Postby Silvio.Falconi » Wed May 13, 2015 7: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6920
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show boxes color on a dialog

Postby ukoenig » Wed May 13, 2015 4: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.

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Show boxes color on a dialog

Postby Silvio.Falconi » Thu May 14, 2015 8: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

Image


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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6920
Joined: Thu Oct 18, 2012 7:17 pm

Re: Show boxes color on a dialog

Postby Enrico Maria Giordano » Thu May 14, 2015 8:24 am

Silvio,

use TSay intstead of TGet.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8569
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Show boxes color on a dialog

Postby ukoenig » Thu May 14, 2015 9: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

Image

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

Image

color-selecting sample of 1. zebra-color

Code: Select all  Expand view

//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 :)
Last edited by ukoenig on Sat May 16, 2015 12:51 pm, edited 3 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Show boxes color on a dialog

Postby ukoenig » Sat May 16, 2015 12:30 pm

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Show boxes color on a dialog

Postby Silvio.Falconi » Wed May 20, 2015 7: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6920
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests