Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

GUICtrlCreateTabitem


  • Please log in to reply
32 replies to this topic

#1 MBALZESHARI

MBALZESHARI

    Member of the Hide & Seek world league

  • MVPs
  • 10,941 posts

Posted 06 December 2005 - 12:55 AM

I would love to be able to change the color of a tab. The code would be something like the following:

$tab1 = GuiCtrlCreateTabItem("Groups") GUISetBkColor(0x00E0FFFF, $tab1)


From what I'm currently finding, this can't be done. I'm looking to make a GUI, but the names of the tabs will be a varable, depending on how the user names them. Is there a way to do this that I do not know about?







#2 PartyPooper

PartyPooper

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 689 posts

Posted 06 December 2005 - 01:55 AM

I like this idea too. Be nice to change the colour of the Tab text as well.

$tab1 = GuiCtrlCreateTabItem("Groups") GUICtrlSetColor(-1, 0x0000ff)



EDIT: forgot to include an example of what I mean.. DUH!

Edited by PartyPooper, 06 December 2005 - 01:57 AM.


#3 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,196 posts

Posted 06 December 2005 - 02:10 AM

per help

The "tabitem" control cannot be painted (too much code ...)


8)

Posted Image

Clic The Pic!!!


#4 MBALZESHARI

MBALZESHARI

    Member of the Hide & Seek world league

  • MVPs
  • 10,941 posts

Posted 06 December 2005 - 10:40 AM

:P

#5 PartyPooper

PartyPooper

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 689 posts

Posted 06 December 2005 - 01:30 PM

It's a pity graphics don't work on tabs properly or you could use that to colour a tab.

#6 star2

star2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 461 posts

Posted 13 January 2008 - 07:30 AM

The "tabitem" control cannot be painted (too much code ...)


the one thing that was missing !! :D

isn't this gonna be fixed?

Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams

.............................................................................AUTOIT

#7 FreeFry

FreeFry

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 968 posts

Posted 13 January 2008 - 07:36 AM

the one thing that was missing !! :D

isn't this gonna be fixed?

Nice 2+ year bump...

And it's not a bug, it's just (as stated in the helpfile), not allowed becaues it would(probably) require too much code.
I would say that it's possible to do using dllcalls though.. but that's .. yep. that's that. :E

#8 star2

star2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 461 posts

Posted 13 January 2008 - 08:03 AM

Nice 2+ year bump...

And it's not a bug, it's just (as stated in the helpfile), not allowed becaues it would(probably) require too much code.
I would say that it's possible to do using dllcalls though.. but that's .. yep. that's that. :E


that's what?

I know it's not a bug what I meant is when is the coloring will be possible?

just give me a Dll function that can do the coloring stuff !!
I really need that right now

Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams

.............................................................................AUTOIT

#9 GEOSoft

GEOSoft

    Sure I'm senile. What's your excuse?

  • MVPs
  • 10,573 posts

Posted 13 January 2008 - 08:45 AM

that's what?

I know it's not a bug what I meant is when is the coloring will be possible?

Probably never.

just give me a Dll function that can do the coloring stuff !!

You'll have to try and find that yourself. I don't recall seeing where any of the users were working on it and since it's not a planned feature then you can bet the devs have more important issues an their minds.

I really need that right now

And I'm really sorry to hear that, becuase unless you find a method (using a dll or ocx file) by yourself then you will not have it "right now". And like freefly pointed out you have dragged up an issue that was dead 2 years ago. If anything was going to change it would have been posted by now.
GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!"

#10 star2

star2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 461 posts

Posted 13 January 2008 - 08:53 AM

Probably never.

You'll have to try and find that yourself. I don't recall seeing where any of the users were working on it and since it's not a planned feature then you can bet the devs have more important issues an their minds.

And I'm really sorry to hear that, becuase unless you find a method (using a dll or ocx file) by yourself then you will not have it "right now". And like freefly pointed out you have dragged up an issue that was dead 2 years ago. If anything was going to change it would have been posted by now.

I've become an annoying person I guess !!
[ FreeFry ] mentioned that it can be done using the Dll Funcs, I tried to look in msdn long time ago, but to tell u the truth I was lost there !!
anyway thanks for the help and sorry for the inconvenience. :D

EDIT: [ what I meant by right now was at the present sorry for the rong word !! ]

Edited by star2, 13 January 2008 - 08:54 AM.

Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams

.............................................................................AUTOIT

#11 FreeFry

FreeFry

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 968 posts

Posted 13 January 2008 - 05:17 PM

I said that it could probably be done with DllCalls()..
other than that.. i recall seeing a custom library(include file) that allowed for much customized gui's, that was posted on this forum somewhere.. cant remember the name of it

#12 Wooltown

Wooltown

    Alpha Geek

  • Active Members
  • PipPipPipPipPipPip
  • 478 posts

Posted 28 January 2008 - 10:49 AM

I have made a solution for it, see below

Hopefully it is easy to understand

To color the entire tab use: _GUICtrlTab_GetDisplayRect to find the coordinates


    Global $ColorTab     $TabItem[0] = GUICtrlCreateTab(0, 50, 870, 831)     GUICtrlSetOnEvent($TabItem[0], "TabEvent") Func TabEvent()     Local $l_tab, $l_tabX, $l_tabY, $l_margin, $l_coord, $l_text     $l_tab = _GUICtrlTab_GetCurSel(GUICtrlGetHandle($TabItem[0]))     $l_tabX = 0 ; X-position in Main GUI     $l_tabY = 50 ; Y-position in Main GUI     $l_margin = 2 ; Margin in TabItem htat should not be colored     $l_coord = _GUICtrlTab_GetItemRect(GUICtrlGetHandle($TabItem[0]), $l_tab); Get coordinates of TabItem     $l_text = _GUICtrlTab_GetItemText(GUICtrlGetHandle($TabItem[0]), $l_tab); Get text of TabItem     GUICtrlDelete ($ColorTab) ; Delete the Label     $ColorTab = GUICtrlCreateLabel($l_text,$l_tabX + $l_coord[0] + $l_margin ,$l_tabY + $l_coord[1] + $l_margin,$l_coord[2] - $l_coord[0] - ($l_margin * 2),$l_coord[3] - $l_coord[1] - ($l_margin * 2),BitOr($SS_NOTIFY,$SS_CENTER)); Create the label     GUICtrlsetBkColor (-1,0xFFFFC0 ); set the color of the label EndFunc


#13 star2

star2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 461 posts

Posted 28 January 2008 - 02:15 PM

I have made a solution for it, see below

Hopefully it is easy to understand

To color the entire tab use: _GUICtrlTab_GetDisplayRect to find the coordinates


    Global $ColorTab     $TabItem[0] = GUICtrlCreateTab(0, 50, 870, 831)     GUICtrlSetOnEvent($TabItem[0], "TabEvent") Func TabEvent()     Local $l_tab, $l_tabX, $l_tabY, $l_margin, $l_coord, $l_text     $l_tab = _GUICtrlTab_GetCurSel(GUICtrlGetHandle($TabItem[0]))     $l_tabX = 0; X-position in Main GUI     $l_tabY = 50; Y-position in Main GUI     $l_margin = 2; Margin in TabItem htat should not be colored     $l_coord = _GUICtrlTab_GetItemRect(GUICtrlGetHandle($TabItem[0]), $l_tab); Get coordinates of TabItem     $l_text = _GUICtrlTab_GetItemText(GUICtrlGetHandle($TabItem[0]), $l_tab); Get text of TabItem     GUICtrlDelete ($ColorTab); Delete the Label     $ColorTab = GUICtrlCreateLabel($l_text,$l_tabX + $l_coord[0] + $l_margin ,$l_tabY + $l_coord[1] + $l_margin,$l_coord[2] - $l_coord[0] - ($l_margin * 2),$l_coord[3] - $l_coord[1] - ($l_margin * 2),BitOr($SS_NOTIFY,$SS_CENTER)); Create the label     GUICtrlsetBkColor (-1,0xFFFFC0 ); set the color of the label EndFunc


thank you for working it around with the label cheat !!
I'm searching some final solution for the tab item coloring for good.

Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams

.............................................................................AUTOIT

#14 Wooltown

Wooltown

    Alpha Geek

  • Active Members
  • PipPipPipPipPipPip
  • 478 posts

Posted 28 January 2008 - 02:23 PM

I have also searched for it, but haven't found a solution so I made this cheat.
But after all it works until a better solution is found.

#15 star2

star2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 461 posts

Posted 29 January 2008 - 07:36 AM

responding to Wooltown cheat:
can anyone tell me what am I doing wrong:
if I compile the script it will give me a var error also the label seems disappear if the tab control loses focus for the first time
example:
AutoIt         
#include <GuiConstantsEx.au3> #include <GuiTab.au3> Global $ColorTab, $TabItem Local $l_tab, $l_tabX, $l_tabY, $l_margin, $l_coord, $l_text,$ColorTab $main = GUICreate ("Test", 400,300) GUISetBkColor (0) $TabItem = GUICtrlCreateTab(5, 5,390, 260) GUICtrlCreateTabItem ("Tab item - 1") GUICtrlCreateTabItem ("") GUICtrlCreateTabItem ("Tab item - 2") GUICtrlCreateTabItem ("") GUICtrlCreateTabItem ("Tab item - 3") GUICtrlCreateTabItem ("") GUICtrlCreateTabItem ("Tab item - 4") GUICtrlCreateTabItem ("") $go = GUICtrlCreateButton ("test", 5, 270, 390,25) $l_tabo = _GUICtrlTab_GetCurSel(GUICtrlGetHandle($TabItem)) IniWrite ("test.ini", "Selected", "Tab item selected", $l_tabo) $l_tab = _GUICtrlTab_GetCurSel(GUICtrlGetHandle($TabItem)) $l_coord = _GUICtrlTab_GetItemRect(GUICtrlGetHandle($TabItem), $l_tab); Get coordinates of TabItem $l_text = _GUICtrlTab_GetItemText(GUICtrlGetHandle($TabItem), $l_tab); Get text of TabItem GUICtrlGetHandle($ColorTab) $ColorTab = GUICtrlCreateLabel($l_text,$l_coord[0] +5 ,$l_coord[1] + 5,$l_coord[2] - $l_coord[0],$l_coord[3] - $l_coord[1] ,BitOr($SS_NOTIFY,$SS_CENTER)); Create the label GUICtrlsetBkColor ($ColorTab,0xFFFFC0 ); set the color of the label GUISetState () While 1     $msg = GUIGetMsg ()     If $msg = $gui_event_close Then ExitLoop     TabEvent() WEnd Func TabEvent()     $test = IniRead ("test.ini", "Selected", "Tab item selected" , 0)     $l_tab = _GUICtrlTab_GetCurSel(GUICtrlGetHandle($TabItem))     $l_coord = _GUICtrlTab_GetItemRect(GUICtrlGetHandle($TabItem), $l_tab); Get coordinates of TabItem     $l_text = _GUICtrlTab_GetItemText(GUICtrlGetHandle($TabItem), $l_tab); Get text of TabItem     If $test <> $l_tab  Then         $ColorTab = GUICtrlCreateLabel($l_text,$l_coord[0] +5 ,$l_coord[1] + 5,$l_coord[2] - $l_coord[0],$l_coord[3] - $l_coord[1] ,BitOr($SS_NOTIFY,$SS_CENTER)); Create the label         GUICtrlsetBkColor ($ColorTab,0xFFFFC0 ); set the color of the label         IniWrite ("test.ini", "Selected", "Tab item selected", $l_tab)         $test = $l_tab     EndIf     If $msg = $go Then         MsgBox (-1, "", _GUICtrlTab_GetItemState ($main,0))     EndIf EndFunc

Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams

.............................................................................AUTOIT

#16 Wooltown

Wooltown

    Alpha Geek

  • Active Members
  • PipPipPipPipPipPip
  • 478 posts

Posted 29 January 2008 - 08:43 AM

I made it work better, but still the problem when the tabs oses focus in the beginning, I will check more, have a lot of stuff to do rigt how.

Plain Text         
#include <GuiConstantsEx.au3> #include <GuiTab.au3> Global $ColorTab, $TabItem, $go, $msg $main = GUICreate ("Test", 400,300) GUISetBkColor (0) $TabItem = GUICtrlCreateTab(5, 5,390, 260) GUICtrlCreateTabItem ("Tab item - 1") GUICtrlCreateTabItem ("") GUICtrlCreateTabItem ("Tab item - 2") GUICtrlCreateTabItem ("") GUICtrlCreateTabItem ("Tab item - 3") GUICtrlCreateTabItem ("") GUICtrlCreateTabItem ("Tab item - 4") GUICtrlCreateTabItem ("") $go = GUICtrlCreateButton ("test", 5, 270, 390,25) _GUICtrlTab_SetCurSel(GUICtrlGetHandle($TabItem),0) _GUICtrlTab_SetCurFocus(GUICtrlGetHandle($TabItem),0) TabEvent() GUISetState () While 1     $msg = GUIGetMsg ()     If $msg = $gui_event_close Then ExitLoop     if $msg = $TabItem Then TabEvent()     if $msg = $go Then Tab1() WEnd Func TabEvent()     Local $l_tab, $l_tabX, $l_tabY, $l_margin, $l_coord, $l_text   ; $test = IniRead ("test.ini", "Selected", "Tab item selected" , 0)     $l_tabX = 5     $l_tabY = 5     $l_margin = 1     $l_tab = _GUICtrlTab_GetCurSel(GUICtrlGetHandle($TabItem))     $l_coord = _GUICtrlTab_GetItemRect(GUICtrlGetHandle($TabItem), $l_tab); Get coordinates of TabItem     $l_text = _GUICtrlTab_GetItemText(GUICtrlGetHandle($TabItem), $l_tab); Get text of TabItem    ;If $test <> $l_tab  Then         GUICtrlDelete($ColorTab)         $ColorTab = GUICtrlCreateLabel($l_text, $l_tabX + $l_coord[0] + $l_margin, $l_tabY + $l_coord[1] + $l_margin, $l_coord[2] - $l_coord[0] - ($l_margin * 2), $l_coord[3] - $l_coord[1] - ($l_margin * 2), BitOR($SS_NOTIFY, $SS_CENTER, $SS_SUNKEN))         GUICtrlsetBkColor ($ColorTab,0xFFFFC0 ); set the color of the label     ;   IniWrite ("test.ini", "Selected", "Tab item selected", $l_tab)      ;  $test = $l_tab    ;EndIf     _GUICtrlTab_SetCurFocus(GUICtrlGetHandle($TabItem),$l_tab) EndFunc Func Tab1()     If $msg = $go Then         MsgBox (0, "", _GUICtrlTab_GetItemState ($main,0))     EndIf EndFunc


#17 star2

star2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 461 posts

Posted 29 January 2008 - 08:53 AM

I was really sleeping when I wrote this script and I woke up 2 hours ago but now I'm in the office now, can't wait to check for solution for losing focus.
nice job Wooltown

Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams

.............................................................................AUTOIT

#18 star2

star2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 461 posts

Posted 29 January 2008 - 09:01 AM

by the way the compiling problem still exists !!

Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams

.............................................................................AUTOIT

#19 Wooltown

Wooltown

    Alpha Geek

  • Active Members
  • PipPipPipPipPipPip
  • 478 posts

Posted 29 January 2008 - 09:12 AM

I get it to work running Windows 2000 and the AutoIT 3.2.10.0

#20 Wooltown

Wooltown

    Alpha Geek

  • Active Members
  • PipPipPipPipPipPip
  • 478 posts

Posted 29 January 2008 - 09:13 AM

The problem it loses focus and the label disappears, can it be an AutoIT bug ?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users