AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

White Header (Gui style)

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
AiKscroll



Joined: 06 Jun 2005
Posts: 179
Location: Northern Virginia

PostPosted: Thu Feb 09, 2006 4:22 am    Post subject: White Header (Gui style) Reply with quote

Working Script:
Code:

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:


==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:

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?
Code:

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


Last edited by AiKscroll on Thu Feb 09, 2006 5:53 am; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
Serenity



Joined: 07 Nov 2004
Posts: 1275

PostPosted: Thu Feb 09, 2006 4:48 am    Post subject: Reply with quote

Unfortunately your code produces a very visible edit control on 2k. Try this instead:

Code:
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
Back to top
View user's profile Send private message Visit poster's website
shimanov



Joined: 25 Sep 2005
Posts: 612

PostPosted: Thu Feb 09, 2006 4:50 am    Post subject: Reply with quote

This creates a nice effect.

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

Code:
Gui, Add, Progress, x0 y0 w350 h50 backgroundWhite
Back to top
View user's profile Send private message
AiKscroll



Joined: 06 Jun 2005
Posts: 179
Location: Northern Virginia

PostPosted: Thu Feb 09, 2006 5:21 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message AIM Address
Titan



Joined: 11 Aug 2004
Posts: 5382
Location: /b/

PostPosted: Thu Feb 09, 2006 4:55 pm    Post subject: Reply with quote

You can achieve this with a static text control: Gui, Add, Text, x-2 y-2 w504 h50 Border 0x6


Screenshot:


Code:
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

_________________

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group