Window/Dialog Title bar color
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Window/Dialog Title bar color
Hi Everybody,
How can I change just the window title bar to a different color?
How can I change just the window title bar to a different color?
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Yes you can change the color of the Window/Dialog Title bar.
But you can't do it in FWH.
You can change it in the properties of your screen by right clicking on the desktop and chosing "properties".
Good luck.[/img]
But you can't do it in FWH.
You can change it in the properties of your screen by right clicking on the desktop and chosing "properties".
Good luck.[/img]
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Just to be sure we are talking about the same thing....
I want to give the user a visual notification when they have changed a certain setting.
http://www.can-soft.net/dl/Title.jpg
I want to give the user a visual notification when they have changed a certain setting.
http://www.can-soft.net/dl/Title.jpg
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Dialog-Titles
Hello,
With the VTools you can create any Dialog-Title-Styles and Size :
Gradients, Brushes, Mono-Colors, Fonts, with or without frames and more.
For Windows, it seems not possible, because there is allways a title on top.
Maybe somebody knows, how to get a empty window ?
A sample :
Regards
Uwe
With the VTools you can create any Dialog-Title-Styles and Size :
Gradients, Brushes, Mono-Colors, Fonts, with or without frames and more.
For Windows, it seems not possible, because there is allways a title on top.
Maybe somebody knows, how to get a empty window ?
A sample :
Code: Select all
// Create a Bitmap on top of the Dialog. Use a little Bitmap ( Blanc )
// as container. The Dialog should be just a frame.
// The Bitmap ( Blanc 20 x 20 ) will be resized and filled with the
// defined Brush / Gradient / Color :
REDEFINE BITMAP oBmp1 ID 100 ADJUST RESOURCE "Blanc" OF oDlg
oBMP1:bPainted := { |hDC|OnPaint( hDC,oBMP1, 128,15779475, 77215, ;
"Horizontal Dialog Title", ;
oBfont1, 0 ,"TEST.BMP" ,3 ) }
//--------------- Paint the Dialog-Title --------------------------------//
FUNCTION ONPAINT(hDC,oBmp,nVColor, nBColor,nColor,cText, ;
oBFont1, nLEFT, cBRUSH, nPEN )
LOCAL hOldFont, oNewbrush, hBitmap, aRect, oBmp1, nTOP
hOldFont := SelectObject( hDC, oBFont1:hFont )
nTOP := 5
nTXTLG := GettextWidth( hDC, cText )
nBMPLONG := oBmp:Super:nWidth()
nBMPHIGHT := oBmp:Super:nHeight()
nFONTHIGHT := oBfont1:nInpHeight * -1
nLEFT := (nBMPLONG - nTXTLG) / 2
nNEWHIGHT := nFONTHIGHT
nTOP := (nBMPHIGHT - nNEWHIGHT) / 2
aRect := GETCLIENTRECT( oBmp:hWnd )
nGRADIENT := Gradient( hDC, aRect, nVColor, nBColor, .T. ) // .T. Horizontal
oBmp:oBrush := TBrush():New( , nGRADIENT )
SetTextColor( hDC,nColor)
SetBkMode( oBmp:hDC, 0 )
FillRect( hDC, aRect, oBmp:oBrush:hBrush )
TextOut( hDC, nTOP, nLEFT, cText )
SelectObject( hDC, hOldFont )
IF nPEN > 0
DRAWBOX( aRect, hDC, nColor, nBMPLONG, nBMPHIGHT, nPEN )
ENDIF
RETURN NIL
// -------- DRAW BOX --------------------------------
STATIC FUNCTION DRAWBOX( aRect, hDC, nColor, nBMPLONG, nBMPHIGHT, nPEN )
LOCAL hPen := CREATEPEN( PS_SOLID, nPEN, nColor )
LOCAL hOldPen := SELECTOBJECT( hDC, hPen )
MOVETO( hDC, 0, 0 )
LINETO( hDC, nBMPLONG, 0 )
LINETO( hDC, nBMPLONG, nBMPHIGHT )
LINETO( hDC, 0, nBMPHIGHT )
LINETO( hDC, 0, 0 )
SELECTOBJECT( hDC, hOldPen )
DELETEOBJECT( hPen )
RETURN NIL
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
Sample
Hello,
Here is a Sample-Screenshot :
The Dialog-Gradient works also with older-versions of FWH.
The Button < New text > changes the Dialog-Title-Text.
If somebody needs the source, i can put it in the forum.
Sample Download :
http://www.pflegeplus.com/fw_downloads/DlgTitle.zip
Regards
Uwe
Here is a Sample-Screenshot :
The Dialog-Gradient works also with older-versions of FWH.
The Button < New text > changes the Dialog-Title-Text.
If somebody needs the source, i can put it in the forum.
Sample Download :
http://www.pflegeplus.com/fw_downloads/DlgTitle.zip
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
-
- Posts: 189
- Joined: Sun Jul 08, 2007 1:46 am
- Location: Uruguay
Download
Hello Ruben,
A complete Source ( exe, resource, RMK ... )
with many new parameters, i put tomorrow in the forum.
nColor1 :=128 // 1. Gradient-Color
nColor2 := 15779475 // 2. Gradient-Color
nColort := 16777215 // Text-Color
lGrad := .T. // Gradient or MONO-Color
cText := "Horizontal Dialog Title" // Text
nTop := 10 // Top Text-Pos. 0 = Center Vertical
nLeft := 0 // Left Text-Pos. 0 = Center Horizontal
nPen := 0 // Pen-Weight for Frame 0 = no Frame
nPColor := 16777215 // Frame-Color
cBrush := "" // Title BMP-Brush
Regards
Uwe
A complete Source ( exe, resource, RMK ... )
with many new parameters, i put tomorrow in the forum.
nColor1 :=128 // 1. Gradient-Color
nColor2 := 15779475 // 2. Gradient-Color
nColort := 16777215 // Text-Color
lGrad := .T. // Gradient or MONO-Color
cText := "Horizontal Dialog Title" // Text
nTop := 10 // Top Text-Pos. 0 = Center Vertical
nLeft := 0 // Left Text-Pos. 0 = Center Horizontal
nPen := 0 // Pen-Weight for Frame 0 = no Frame
nPColor := 16777215 // Frame-Color
cBrush := "" // Title BMP-Brush
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
Source-Files
Hello,
Here is the complete Source and EXE for the Dialog-Titles
Download :
http://www.pflegeplus.com/fw_downloads/DialogTitle.zip
Regards
Uwe
Here is the complete Source and EXE for the Dialog-Titles
Download :
http://www.pflegeplus.com/fw_downloads/DialogTitle.zip
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Jeff,
>I want to give the user a visual notification when they have changed a certain setting.
May I suggest highlighting the setting that was changed instead. This would give more specific information--coloring the titlebar would only show that something was changed but not what.
Also, even if you could change the titlebar color, I would be worried that different themes might override this.
Regards,
James
>I want to give the user a visual notification when they have changed a certain setting.
May I suggest highlighting the setting that was changed instead. This would give more specific information--coloring the titlebar would only show that something was changed but not what.
Also, even if you could change the titlebar color, I would be worried that different themes might override this.
Regards,
James
Changing Title
Hello James,
It is not only the color. you can change the text, position, drawing
frames around the title and so on at runtime in combination to any action.
Regards
Uwe
It is not only the color. you can change the text, position, drawing
frames around the title and so on at runtime in combination to any action.
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Changing Title
Hello James,
you mean, changing the get-color after changing the value ?
Another sample with dialog-titles on a GET :
In Jeff's sample, he could show the Patient-name in the Dialog-title.
Regards
Uwe
you mean, changing the get-color after changing the value ?
Another sample with dialog-titles on a GET :
In Jeff's sample, he could show the Patient-name in the Dialog-title.
Code: Select all
// Changing Title with GET
// ---------------------------------
REDEFINE GET oText1 VAR cText1 ID 120
oText1:bChange := {|| (nColor1 :=15779475, ;
nColor2 := 128, nColort := 0, ;
cText := "You changed the Get-Field : Customer", ;
lGrad := .F., nTop := 12, nLeft := 20, ;
nPen := 0, nPColor := 0, cBrush := "", ;
oBMP1:Refresh() ) }
// Could also be instead of a Text-Message a Database-Field :
// cText := (1)->PAT_NAME, ;
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Changing Title
Only to note that Uwe's titlebar is not the real titlebar and it will not follow current Windows theme. Or am I wrong?
EMG
EMG