Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

White Header (Gui style)


  • Please log in to reply
4 replies to this topic
AiKscroll
  • Members
  • 179 posts
  • Last active: Feb 25 2007 03:10 AM
  • Joined: 06 Jun 2005
Working Script:
adjust_len = 300

Gui, Add, Progress, x0 y0 w%adjust_len% h50 backgroundWhite +Theme ; white header
Gui, Add, Text, x0 yp+38 +Backgroundtrans, ___________________________________________________________ ; enough to exceed length of window
Gui, Add, Picture, xp+5 yp-30, %A_AhkPath%
Gui, Font, bold
Gui, Add, Text, xp+35 yp+10 +Backgroundtrans, Title
Gui, Font, norm
width := adjust_len - 10
Gui, Add, Text, xp-35 yp+45 w%width%, This is an exmple of a GUI that has a white header with an icon and title contained inside of it.
Gui, Show, w%adjust_len%
Pic:
Posted Image

==Orig. Message==
Many programs feature a GUI where the top is white and stylized. I found a way to produce that in AHK, but it's inperfect, using an edit control. Code is below.

See example here:
Posted Image
In Fig. 1, the line is blue where it should be black. Ok that's not a huge problem but there's more. If you mouse over it you get an 'I' cursor. Also, if clicked upon the edit goes above the text; very undesired. I have tried making the edit Disabled and ReadOnly but then it is no longer white.

Can anyone think of a better fix/approach to this?
Gui, +ToolWindow
Gui, Add, Edit, w350 h50 x0 y0
Gui, Add, Picture, xp+5 yp+10, media\globalsuggestion.ico
Gui, Add, Text, BackgRoundtrans xp+35 yp+10, Add a Suggestion:
Gui, Add, Text, BackgRoundtrans xp-35 yp+40, Username:
Gui, Add, Edit, xp+75 yp-3 vtxtusername w200, stevem
Gui, Add, Text, BackgRoundtrans xp-75 yp+30, Suggestion:
Gui, Add, Edit, xp+75 yp-3 vtxtsuggestion r5 w200
Gui, Add, Button, xp+50 yp+75 w75 gButtonAddSuggestionOK, OK
Gui, Add, Button, xp+75 yp+0 w75 gButtonAddSuggestionCancel, Cancel
Gui, Show, w290, Add a Suggestion

_AiK

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
Unfortunately your code produces a very visible edit control on 2k. Try this instead:

Gui, +ToolWindow
Gui, Add, Text, 0x6 w350 h50 x0 y0 ; 0x6 = SS_WHITERECT 
Gui, Add, Text, 0x4 w350 h1 x0 y+1 ; 0x4 = SS_BLACKRECT
Gui, Add, Picture, x5 y10, autohotkey.ico
Gui, Add, Text, BackgRoundtrans xp+35 yp+10, Add a Suggestion:
Gui, Add, Text, BackgRoundtrans xp-35 yp+40, Username:
Gui, Add, Edit, xp+75 yp-3 vtxtusername w200
Gui, Add, Text, BackgRoundtrans xp-75 yp+30, Suggestion:
Gui, Add, Edit, xp+75 yp-3 vtxtsuggestion r5 w200
Gui, Add, Button, xp+50 yp+75 w75 gButtonAddSuggestionOK, OK
Gui, Add, Button, xp+75 yp+0 w75 gButtonAddSuggestionCancel, Cancel
Gui, Show, w290, Add a Suggestion
return

ButtonAddSuggestionOK:
ButtonAddSuggestionCancel:
return

"Anything worth doing is worth doing slowly." - Mae West
Posted Image

shimanov
  • Members
  • 610 posts
  • Last active: Jul 18 2006 08:35 PM
  • Joined: 25 Sep 2005
This creates a nice effect.

Try replacing the "Gui, ...Edit" with

Gui, Add, Progress, x0 y0 w350 h50 backgroundWhite


AiKscroll
  • Members
  • 179 posts
  • Last active: Feb 25 2007 03:10 AM
  • Joined: 06 Jun 2005
Thanks both of you, I sort of combined both. It is still a make shift way of producing it, but anything is good. I'd also like to add that all update my first post to make it more univeral so anyone can use it (also why I didn't post in Help).
_AiK

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
You can achieve this with a static text control: Gui, Add, Text, x-2 y-2 w504 h50 Border 0x6


Screenshot:
Posted Image

Gui, Add, Text, x-2 y-2 w504 h50 Border 0x6
Gui, Add, Pic, Section xm ym Icon4, %A_AhkPath%
Gui, Font, bold
Gui, Add, Text, xs+50 ys+5 +BackgroundTrans, GUI: window styles and themes
Gui, Font
Gui, Add, Text, xm ys+60, This is a sample GUI window that uses a white rectangle header.
Gui, Add, Button, xm+435 w50 gGuiClose, Close
GuiControl, Focus, Static1
Gui, Show, w500, Example
Return

GuiClose:
ExitApp

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit