Jump to content

Icon and Tab


 Share

Recommended Posts

If you place an icon on top of the Tab control then it will have a white background color. Why? I hope that this bug (feature) will be fixed in the AutoIt v3.3.0.0, but it is there. It is time to make compromises (degrade code), it is very inconvenient. Developers, will the next version of AutoIt is corrected?

GUICreate('Test', 380, 400)
GUICtrlCreateTab(10, 10, 360, 380)
GUICtrlCreateTabItem('Tab')
GUICtrlCreateIcon('shell32.dll', -7, 40, 65, 32, 32)
GUISetState()

do
until GUIGetMsg() = -3

Also has the following bug: http://www.autoitscript.com/forum/index.php?showtopic=89387

It is like that in the following versions of AutoIt has improved support for Icon and Tab controls.

Thanks.

Link to comment
Share on other sites

I don't see what you are getting at here. What I'm seeing is the default tab color.

GUICreate('Test', 380, 400)
GUICtrlCreateTab(10, 10, 360, 380)
GUICtrlCreateTabItem('Tab')
;GUICtrlCreateIcon('shell32.dll', -7, 40, 65, 32, 32)
GUICtrlCreateLabel("This is some text", 40, 65, 160, 20)
GUISetState()

do
until GUIGetMsg() = -3

And

GUICreate('Test', 380, 400)
GUICtrlCreateTab(10, 10, 360, 380)
GUICtrlCreateTabItem('Tab')
;GUICtrlCreateIcon('shell32.dll', -7, 40, 65, 32, 32)
;GUICtrlCreateLabel("This is some text", 40, 65, 160, 20)
GUISetState()

do
until GUIGetMsg() = -3

Give the same results.

George

Question 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!"

Link to comment
Share on other sites

  • Moderators

GEOSoft,

I thought the same thing, until I coloured the Tab:

#include <GuiConstantsEx.au3>
#include <GuiTab.au3>

$hGUI = GUICreate('Test', 380, 400)
GUISetBkColor(0Xff0000, $hGUI)

GUICtrlCreateIcon('shell32.dll', -7, 10, 10, 32, 32)

$hTab = GUICtrlCreateTab(50, 10, 300, 380)
GUICtrlCreateTabItem('Tab')
    _GUICtrlTab_SetBkColor($hGUI, $hTab, 0x00FF00)
GUICtrlCreateIcon('shell32.dll', -7, 80, 65, 32, 32)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _GUICtrlTab_SetBkColor($hWnd, $hSysTab32, $sBkColor)
    Local $aTabPos = ControlGetPos($hWnd, "", $hSysTab32)
    
    Local $aTab_Rect = _GUICtrlTab_GetItemRect($hSysTab32, -1)
    
    GUICtrlCreateLabel("", $aTabPos[0]+2, $aTabPos[1]+$aTab_Rect[3]+4, $aTabPos[2]-6, $aTabPos[3]-$aTab_Rect[3]-7)
    GUICtrlSetBkColor(-1, $sBkColor)
    GUICtrlSetState(-1, $GUI_DISABLE)
EndFunc

I presume Yashied is running with a non-standard tab background colour which makes the white icon background stand out.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I don't see what you are getting at here. What I'm seeing is the default tab color.

GUICreate('Test', 380, 400)
GUICtrlCreateTab(10, 10, 360, 380)
GUICtrlCreateTabItem('Tab')
GUICtrlCreateIcon('shell32.dll', -7, 40, 65, 32, 32)
GUISetState()

Opt('PixelCoordMode', 2)

MsgBox(0, '', 'Tab color: ' & '0x' & StringRight(Hex(PixelGetColor(39, 65)), 6) & @CR & @CR & 'Icon background color: ' & '0x' & StringRight(Hex(PixelGetColor(40, 65)), 6))
Link to comment
Share on other sites

Okay I see it now. It's not picking up the transparency.

George

Question 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!"

Link to comment
Share on other sites

The overlapping of control is user reponsability so painting a label and creating on icon that overlap does not means that the icon will take label painting .

The icon is paint as as tab. as a tab cannot be paint you get the transparency on the tab that to say white or grey depending of the theme

Link to comment
Share on other sites

The overlapping of control is user reponsability so painting a label and creating on icon that overlap does not means that the icon will take label painting .

The icon is paint as as tab. as a tab cannot be paint you get the transparency on the tab that to say white or grey depending of the theme

jmp, please look at my example (Post #4), I do not use any filling, it is a standard color tab.
Link to comment
Share on other sites

jmp, please look at my example (Post #4), I do not use any filling, it is a standard color tab.

For me it is working as designed the icon backgound is the same as the tab background. verified with vista style (white) or classic theme (grey)
Link to comment
Share on other sites

Link to comment
Share on other sites

I think it works differently for different themes. I use Windows XP with default (not classic) theme.

Thanks.

You right different behavior due to the way autoit can find the back color of a tab (upper left pixel)
Link to comment
Share on other sites

Link to comment
Share on other sites

Link to comment
Share on other sites

Your test is wrong. This test is correct:

GUICreate('Test', 380, 400)
GUICtrlCreateTab(10, 10, 360, 380)
Local $hTab = GUICtrlGetHandle(GUICtrlCreateTabItem('Tab'))
GUICtrlCreateIcon('shell32.dll', -7, 40, 65, 32, 32)
GUISetState()

Opt('PixelCoordMode', 2)

MsgBox(0, '', 'Tab color: ' & '0x' & StringRight(Hex(PixelGetColor(0, 0, $hTab)), 6) & @CR & @CR & 'Icon background color: ' & '0x' & StringRight(Hex(PixelGetColor(40, 65)), 6))

My code gets the top-left pixel of the Tab control unconditionally. Your test is relying on what you see and not what AutoIt sees. My test confirms that AutoIt is working as designed.

Link to comment
Share on other sites

  • Moderators

Addressed to the Devs,

The Help file states: "To have a transparent picture it is needed to create the GUI window with WS_EX_LAYERED extended style. The left-top pixel will be used as the transparency color. If several pictures are created the last picture is defining the transparent color. See example 2."

Would it be it very difficult to change the code to look at the left-top of the pixel under the Pic/Icon control rather than the underlying Tab/GUI? I can imagine such a solution would still respect "the last picture is defining the transparent color", but offer a little more flexibility to the user.

I am quite prepared to believe that this would be too difficult to incorporate, but I ask out of curiosity.

M23

Edit: speeling

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Your test is wrong. This test is correct:

Valik, please look at my screenshot. I work in Windows XP with Default (not Windows Classic) Windows XP theme. What this? :P

Posted Image

And what can you say on the second issue? http://www.autoitscript.com/forum/index.php?showtopic=89387

I think that there is a need to improve support for icons in future versions of the AutoIt.

Edited by Yashied
Link to comment
Share on other sites

It's already been pointed out that the issue is with painting the tab. If you look in the list of things that won't be changed, it's in there. It's a major issue to make the modifications and the icons are working as designed.

Remember that not everything will be possible in AutoIt. If the AutoIt base code ever changes then changes like you want may get addressed but I wouldn't look for it to happen in the next 2 or 3 days.

George

Question 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!"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...