dryan Posted May 21, 2007 Posted May 21, 2007 Is it possible to put a graphic control on a tabitem? The AutoIt API for GUICtrlCreateTabItem says "tabitem control cannot be painted (too much code ...)," but I'm not quite sure what that means. For example, if you uncomment the lines below to create tabs, the graphic doesn't show up anymore. Any ideas? #include <GUIConstants.au3> $Form = GUICreate("Test", 400, 300, 300, 300) ;$PageControl = GUICtrlCreateTab(10, 10, 380, 280) ;$TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $Graphic = GUICtrlCreateGraphic(50, 50, 300, 200) GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetColor(-1,0) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x0000ff,0xff0000) GUICtrlSetGraphic(-1,$GUI_GR_RECT,50,50, 200,100) ;$TabSheet2 = GUICtrlCreateTabItem("TabSheet2") ;GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 If GUIGetMsg()=$GUI_EVENT_CLOSE Then Exit WEnd
November Posted May 21, 2007 Posted May 21, 2007 Like this? #include <GUIConstants.au3> $Form = GUICreate("Test", 400, 300, 300, 300) $PageControl = GUICtrlCreateTab(10, 10, 380, 280) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $Graphic = GUICtrlCreateButton("test", 50, 50, 300, 200) GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetColor(-1,0) ;GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x0000ff,0xff0000) ;GUICtrlSetGraphic(-1,$GUI_GR_RECT,50,50, 200,100) $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") $Graphic2 = GUICtrlCreateButton("test 2", 50, 50, 300, 200) ;GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 If GUIGetMsg()=$GUI_EVENT_CLOSE Then Exit WEnd Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
dryan Posted May 21, 2007 Author Posted May 21, 2007 (edited) Yep, exactly like that, except instead of buttons I want to put a graphic control on the tab. The problem is the graphic control doesn't show up when I have it on a tab. Edited May 21, 2007 by dryan
James Posted May 21, 2007 Posted May 21, 2007 Replace the buttons with your code then. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
dryan Posted May 21, 2007 Author Posted May 21, 2007 Yeah, that's the problem. When I do that, it is as if the graphic control gets put behind the tab (instead of on top of it) as shown in the code below. If you change the position of the graphics object so it is outside of the tab, you'll be able to see it. For example, change the x-position of the graphics object to zero and you'll see it come out the side of the tab. #include <GUIConstants.au3> $Form = GUICreate("Test", 400, 300, 300, 300) $PageControl = GUICtrlCreateTab(10, 10, 380, 280) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $Graphic = GUICtrlCreateGraphic(50, 50, 300, 200) ;Change 1st parameter to 0. GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetColor(-1,0) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x0000ff,0xff0000) GUICtrlSetGraphic(-1,$GUI_GR_RECT,0,0, 200,100) $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 If GUIGetMsg()=$GUI_EVENT_CLOSE Then Exit WEnd
November Posted May 21, 2007 Posted May 21, 2007 I think that you should pay attention in the gui order . Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
dryan Posted May 21, 2007 Author Posted May 21, 2007 Good idea, november, but I don't see a problem with the order. When a button is used instead of the graphics control, it shows up just fine. I think it has to do with what the API says about tabitem, "tabitem control cannot be painted (too much code ...)."
November Posted May 21, 2007 Posted May 21, 2007 Good idea, november, but I don't see a problem with the order.When a button is used instead of the graphics control, it shows up just fine.I think it has to do with what the API says about tabitem, "tabitem control cannot be painted (too much code ...)."You have to design controls for each tabTab - designNext tab - next designAnd so on!I think that should od the trick! Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
dryan Posted May 21, 2007 Author Posted May 21, 2007 I appreciate everyone's quick responses, but I must not be explaining the problem clearly enough. I can put other objects on the tabs and it works just fine. When I put a graphic control on it, it doesn't show up on the tabs. I'm going to give you two pieces of code: The first has a graphic control that moves to the right when you click the button. The second is the EXACT same code, except the graphic control is replaced by a button. Try them to see what I mean. expandcollapse popup#include <GUIConstants.au3> $Form = GUICreate("Test", 410, 300, 300, 300) $PageControl = GUICtrlCreateTab(150, 10, 250, 280) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $Graphic = GUICtrlCreateGraphic(15, 75, 120, 200) GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetColor(-1,0) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x0000ff,0xff0000) GUICtrlSetGraphic(-1,$GUI_GR_RECT,5,5, 65,100) $Button = GUICtrlCreateButton("Move the graphic located on TabSheet1.", 165, 45, 225, 22) $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) $toggle = 1 While 1 $msg = GUIGetMsg() If $msg=$GUI_EVENT_CLOSE Then Exit ElseIf $msg=$Button Then GUICtrlSetPos($Graphic,Mod($toggle,4)*50+15, 75, 120, 200) $toggle += 1 EndIf WEndoÝ÷ Ù«¢+Ø¥¹±Õ±ÐíU% ½¹ÍѹÑ̹ÔÌÐì(ÀÌØí½É´ôU% ÉÑ ÅÕ½ÐíQÍÐÅÕ½Ðì°ÐÄÀ°ÌÀÀ°ÌÀÀ°ÌÀÀ¤(ÀÌØíA ½¹Ñɽ°ôU% Ñɱ ÉÑQ ÄÔÀ°ÄÀ°ÈÔÀ°ÈàÀ¤(ÀÌØíQM¡ÐÄôU% Ñɱ ÉÑQ%Ñ´ ÅÕ½ÐíQM¡ÐÄÅÕ½Ðì¤(ÀÌØíÉÁ¡¥ôU% Ñɱ ÉÑ ÕÑѽ¸ ÅÕ½ÐíÑÍÐÅÕ½Ðì°ÄÔ°ÜÔ°ÄÈÀ°ÈÀÀ¤í ÕÑѽ¸ÌÌìÌÌìÌÌì(ÀÌØí ÕÑѽ¸ôU% Ñɱ ÉÑ ÕÑѽ¸ ÅÕ½Ðí5½ÙÑ¡ÉÁ¡¥±½Ñ½¸QM¡ÐĸÅÕ½Ðì°ÄØÔ°ÐÔ°ÈÈÔ°ÈȤ(ÀÌØíQM¡ÐÈôU% Ñɱ ÉÑQ%Ñ´ ÅÕ½ÐíQM¡ÐÈÅÕ½Ðì¤()U% Ñɱ ÉÑQ%Ñ´ ÅÕ½ÐìÅÕ½Ðì¤)U%MÑMÑÑ¡M]}M!=¤((ÀÌØíѽ±ôÄ)]¡¥±Ä($ÀÌØíµÍôU%Ñ5Í ¤(%ÀÌØíµÍôÀÌØíU%}Y9Q} 1=MQ¡¸($%á¥Ð(%±Í%ÀÌØíµÍôÀÌØí ÕÑѽ¸Q¡¸($%U% ÑɱMÑA½Ì ÀÌØíÉÁ¡¥±5½ ÀÌØíѽ±°Ð¤¨ÔÀ¬ÄÔ°ÜÔ°ÄÈÀ°ÈÀÀ¤($$ÀÌØíѽ±¬ôÄ(%¹%)]¹
Emiel Wieldraaijer Posted June 18, 2007 Posted June 18, 2007 (edited) I've got the same problem ... i'm unable to draw a line onto a TAB But if you do it like this .. it works on a TAB (Tnx to BigDog) $SRLine1 = GUICtrlCreateGraphic (30,140,400,1,BitOR($SS_NOTIFY,$SS_SUNKEN)) Edited June 18, 2007 by Emiel Wieldraaijer Best regards,Emiel Wieldraaijer
AMD Posted June 19, 2007 Posted June 19, 2007 I really wish there was a way around this, as was just trying to get rid of two graph pics by replacing them with a graphiccontrol, but my gui is all tabs. As 14 lines of code are a heck of alot smaller then installing the two pic files...
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