HolmesShelock Posted April 30, 2011 Share Posted April 30, 2011 (edited) This is how my code snippet looks like#include <GDIPlus.au3> #include <GUIConstants.au3> #Include <WindowsConstants.au3> $hMainWindow = GUICreate('USB AIO', 705, 369) GUISetBkColor(0xFFFFFF) GUISetState() GUICtrlCreateTab(172 + 4, 10 + 4, 523 - 8, 349 - 8) _GDIPlus_Startup () $hMainGraphicObject = _GDIPlus_GraphicsCreateFromHWND ($hMainWindow) ;~ Loading images $ADD_SCRIPT_BUTTON_IMAGE = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Images\Add.png") $PLAY_SCRIPT_BUTTON_IMAGE = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Images\Play.png") GUICtrlCreateTabItem('TAB 1') $ADD_SCRIPT_BUTTON = _GDIPlus_GraphicsDrawImageRectRect($hMainGraphicObject, $ADD_SCRIPT_BUTTON_IMAGE, 0, 0, 80, 80, 190, 40, 80, 80) GUICtrlCreateTabItem('TAB 2') $PLAY_SCRIPT_BUTTON = _GDIPlus_GraphicsDrawImageRectRect($hMainGraphicObject, $PLAY_SCRIPT_BUTTON_IMAGE, 0, 0, 80, 80, 190, 120, 80, 80) GUICtrlCreateTabItem('') ;~ If I uncomment following lines ;~ $ADD_SCRIPT_BUTTON = _GDIPlus_GraphicsDrawImageRectRect($hMainGraphicObject, $ADD_SCRIPT_BUTTON_IMAGE, 0, 0, 80, 80, 190, 40, 80, 80) ;~ $PLAY_SCRIPT_BUTTON = _GDIPlus_GraphicsDrawImageRectRect($hMainGraphicObject, $PLAY_SCRIPT_BUTTON_IMAGE, 0, 0, 80, 80, 190, 120, 80, 80) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEndThe above script shows a dialog box with two empty tabs. Now, if I comment out the following lines$ADD_SCRIPT_BUTTON = _GDIPlus_GraphicsDrawImageRectRect($hMainGraphicObject, $ADD_SCRIPT_BUTTON_IMAGE, 0, 0, 80, 80, 190, 40, 80, 80) $PLAY_SCRIPT_BUTTON = _GDIPlus_GraphicsDrawImageRectRect($hMainGraphicObject, $PLAY_SCRIPT_BUTTON_IMAGE, 0, 0, 80, 80, 190, 120, 80,@ line no. 16 & 17 & uncomment the same lines @ line no 26 & 27, then both the tabs contain both the images. But what I want is to have the first image in the first tab & the second image in the second. Why is it happening? Is there any way to accomplish it?//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////BTW, I turned "Immediate Notification" of topic replies TURNED ON in my profile 7 checked the appropriate check boxes, but didn't get any mail notification of the reply on the thread which I started previously. Does the mail notification work with this board? Since I'm new here, I'm asking it. Please no hard feelings. Edited April 30, 2011 by HolmesShelock [size="2"][font="arial, verdana, tahoma, sans-serif"]ProtectData - A Data Protection software for floppies[/font][/size] [size="2"][hr][/size][size="2"]Sessionchange - A Windows service capable of tracking session change events[/size][size="2"][b][/b][/size] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 30, 2011 Moderators Share Posted April 30, 2011 HolmesShelock,AutoIt looks after controls created with native commands within the tab structure - as soon as you create controls with UDFs you have to do all the work. Look at the Tabs tutorial in the Wiki to see how to do it. As to the notification when new posts are added, it works fine for me. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
HolmesShelock Posted April 30, 2011 Author Share Posted April 30, 2011 Thank you again Melba23. You pointed me to the exact link. Now I understand the second part that why both the images appear on both the tabs. But, I'm still confused about the first part that why NO image is shown in the first case. [size="2"][font="arial, verdana, tahoma, sans-serif"]ProtectData - A Data Protection software for floppies[/font][/size] [size="2"][hr][/size][size="2"]Sessionchange - A Windows service capable of tracking session change events[/size][size="2"][b][/b][/size] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 30, 2011 Moderators Share Posted April 30, 2011 HolmesShelock, I imagine it is something to do with the layering needed for the tab pages - in my experience images and tabs both do strange things to the expected order of controls. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now