Sign in to follow this  
Followers 0
jjohn

Draw a pie pic on a Tab

4 posts in this topic

#1 ·  Posted (edited)

Please help, I need to draw a pie by GUICtrlSetGraphic on tab2 of the following, I never able to show it, I know it is on the main panel, just covered by the tabs.

Or is it possible at all to draw something on a tab item? :lmao:

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$Form1 = GUICreate("pac man", 622, 441, 192, 125)
$Tab1 = GUICtrlCreateTab(42, 66, 534, 326)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$Graphic1 = GUICtrlCreateGraphic(198, 157, 80, 97)
GUICtrlSetBkColor(-1,0xffffff)
GUICtrlSetColor(-1,0)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff0000,0xff0000)
GUICtrlSetGraphic(-1,$GUI_GR_PIE, 40,40, 40,30,270)
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
GUICtrlSetState(-1,$GUI_SHOW)
GUICtrlCreateTabItem("")
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
;;;;;;;
    EndSelect
WEnd
Exit
Edited by jjohn

Share this post


Link to post
Share on other sites



Graphics are always in the background so you cannot draw on a tab. It is by design

Share this post


Link to post
Share on other sites

thanks for telling me, now i learnt more.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

doens't mean you make it look like it's on the tab.

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$Form1 = GUICreate("pac man", 622, 441, 192, 125)
$gui_graphic = GUICreate("", 529, 300, 45, 90, BitOR($WS_CHILD, $WS_TABSTOP), -1, $Form1)
$Graphic1 = GUICtrlCreateGraphic(198, 157, 80, 97)
GUICtrlSetBkColor(-1, 0xffffff)
GUICtrlSetColor(-1, 0)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000, 0xff0000)
GUICtrlSetGraphic(-1, $GUI_GR_PIE, 40, 40, 40, 30, 270)
GUISwitch($Form1)
$Tab1 = GUICtrlCreateTab(42, 66, 534, 326)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
GUICtrlSetState($gui_graphic, $GUI_SHOW)
GUICtrlCreateTabItem("")
GUISwitch($Form1)
GUISetState(@SW_SHOW, $Form1)
While 1
   $msg = GUIGetMsg()
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
      Case $msg = $Tab1
         $tabidx = GUICtrlRead($Tab1)
         Select
            Case $tabidx = 0
               GUISetState(@SW_HIDE, $gui_graphic)
            Case $tabidx = 1
               GUISetState(@SW_SHOW, $gui_graphic)
            Case $tabidx = 2
               GUISetState(@SW_HIDE, $gui_graphic)
         EndSelect
      Case Else
        ;;;;;;;
   EndSelect
WEnd
Exit
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0