AHK Gui tab styling

Get help with using AutoHotkey and its commands and hotkeys
User avatar
PuzzledGreatly
Posts: 607
Joined: 29 Sep 2013, 22:18

AHK Gui tab styling

12 Jul 2014, 23:00

Is there anyway to change the tab style so that it doesn't use white for the outline? I tried 0x8 but it gave me a thick horrible gray border around the non-active buttons. Thanks:

Code: [Select all] [Download] GeSHi © Codebox Plus

Gui, -Caption  +ToolWindow -DPIScale
Gui, margin, 40,40
Gui, Color, c3366FF, c3366FF
Gui, Font, s40 cWhite bold
Gui, add, Tab2, w1200 h600 +buttons, Tab 1|Tab 2|Tab 3
Gui, show
return

esc:: exitapp
just me
Posts: 4808
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: AHK Gui tab styling

13 Jul 2014, 04:49

:arrow: Default Tab Control Message Processing -> WM_PAINT

I think this cannot be done without subclassing the control, processing the WM_PAINT message, and drawing the control by yourself.
Remaining with AHK 1.1.25.02 until v2 will become beta.
tmplinshi
Posts: 1091
Joined: 01 Oct 2013, 14:57

Re: AHK Gui tab styling

13 Jul 2014, 11:51

In fact, if you add a Tab control with w0 h0 options, then you can use any control as the Tab buttons. An example:

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus


Screenshot
Image
User avatar
PuzzledGreatly
Posts: 607
Joined: 29 Sep 2013, 22:18

Re: AHK Gui tab styling

13 Jul 2014, 18:22

Thanks for the code. Where should I put Class_ImageButton.ahk? I put it in the same folder as my script and added SetWorkingDir %A_ScriptDir% on line 3 of the example but got this error message:

---------------------------
test.ahk
---------------------------
Error at line 4.

Line Text: #Include <Class_ImageButton>
Error: Function library not found.

The program will exit.
---------------------------
OK
---------------------------
tmplinshi
Posts: 1091
Joined: 01 Oct 2013, 14:57

Re: AHK Gui tab styling

13 Jul 2014, 21:35

Change to #Include Class_ImageButton.ahk will work for you.

I suggest put the function/class scripts to the Lib folder, because after then, you can call the functions from any scripts in any location, without copying to the script folder. #include <Class_ImageButton> means include Class_ImageButton.ahk from Lib folder. More details about #Include.
Last edited by tmplinshi on 13 Jul 2014, 21:41, edited 1 time in total.
User avatar
PuzzledGreatly
Posts: 607
Joined: 29 Sep 2013, 22:18

Re: AHK Gui tab styling

13 Jul 2014, 21:40

I've never ever used the Library Folder. I got this message with your suggested changed:

---------------------------
test.ahk
---------------------------
Error at line 4.

#Include file "Class_ImageButton.ahk" cannot be opened.

The program will exit.
---------------------------
OK
---------------------------
tmplinshi
Posts: 1091
Joined: 01 Oct 2013, 14:57

Re: AHK Gui tab styling

13 Jul 2014, 21:44

Are you sure "Class_ImageButton.ahk" is in your script (test.ahk) folder?

#Include Class_ImageButton.ahk ; If Class_ImageButton.ahk is in the script folder
#Include <Class_ImageButton> ; If Class_ImageButton.ahk is in the Lib\ folder
User avatar
PuzzledGreatly
Posts: 607
Joined: 29 Sep 2013, 22:18

Re: AHK Gui tab styling

13 Jul 2014, 22:40

tmplinshi wrote:Are you sure "Class_ImageButton.ahk" is in your script (test.ahk) folder?

#Include Class_ImageButton.ahk ; If Class_ImageButton.ahk is in the script folder


Yes, I'm sure.
tmplinshi
Posts: 1091
Joined: 01 Oct 2013, 14:57

Re: AHK Gui tab styling

13 Jul 2014, 23:54

I guess this is because of your AutoHotkey.exe startup directory is not same as the script directory.
Try #Include Your_Script_Folder_Path\Class_ImageButton.ahk (e.g. #Include D:\scripts\Class_ImageButton.ahk)

=========================================================

Or try this one (It must work...)
test.ahk wrote:#Include <Class_ImageButton>

; If the script file path is D:\scripts\test.ahk,
; then put Class_ImageButton.ahk to D:\scripts\Lib\Class_ImageButton.ahk
User avatar
PuzzledGreatly
Posts: 607
Joined: 29 Sep 2013, 22:18

Re: AHK Gui tab styling

14 Jul 2014, 01:30

Thanks, using the folder's full path worked. Why is that necessary? I don't need to do it with my own includes.
User avatar
jNizM
Posts: 2290
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: AHK Gui tab styling

14 Jul 2014, 01:39

another example with custom tabs

Image
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
tmplinshi
Posts: 1091
Joined: 01 Oct 2013, 14:57

Re: AHK Gui tab styling

14 Jul 2014, 03:00

@PuzzledGreatly Don't know. But you can check out MsgBox, % A_WorkingDir

@jNizM Nice!
User avatar
Klark92
Posts: 132
Joined: 18 Jan 2015, 19:33

Re: AHK Gui tab styling

19 May 2017, 13:55

@jNizM yes I didnt see the code ^^
Smart Kombo 1.0 | One of the best Knight Online's key combo program...

Return to “Ask For Help”

Who is online

Users browsing this forum: A_User, Bing [Bot], Yahoo [Bot] and 56 guests