Jump to content

Recommended Posts

Posted

Can you not use GuiCtrlCreateGraphic and GUICtrlSetResizing together?

If you try the code below you will see the button moves with the gui as you stretch it diagonally out but the graphic does not move.

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 349, 152, 193, 115,BitOr($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX))
$button = GuiCtrlCreateButton("Button",10,10,60,20)
GUICtrlSetResizing ( -1,$GUI_DOCKLEFT )

$dotGr = GuiCtrlCreateGraphic(20, 40, 49, 49)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x000000,0xff0000)
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, 5,5, 10,10)
GuiCtrlSetState(-1,$GUI_Show)
GUICtrlSetResizing ( -1,$GUI_DOCKLEFT  )
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Do 
    Sleep(10)

Until GuiGetMsg() = $GUI_EVENT_CLOSE
Posted

Can you not use GuiCtrlCreateGraphic and GUICtrlSetResizing together?

If you try the code below you will see the button moves with the gui as you stretch it diagonally out but the graphic does not move.

Seems to be something with the way GuiCtrlCreateGraphic and the GuiCtrlSetGraphic commands work with the predefined shapes. If you launch your script and use Au3Info to check the graphic control (with the highlight controls option on), you will see the graphic is created as a "Static" control with the ellipse in the upper Left corner. Resize the form, check the Control again, and you will see that the Static control has indeed resized and moved, but the ellipse gets left behind! Might be something that needs reporting to the developers...

Posted

Seems to be something with the way GuiCtrlCreateGraphic and the GuiCtrlSetGraphic commands work with the predefined shapes. If you launch your script and use Au3Info to check the graphic control (with the highlight controls option on), you will see the graphic is created as a "Static" control with the ellipse in the upper Left corner. Resize the form, check the Control again, and you will see that the Static control has indeed resized and moved, but the ellipse gets left behind! Might be something that needs reporting to the developers...

Thanks, I've posted it in Bug reports so we shall see.

You know I thought that creating a litte dot which changes from Green to Red and moves with the Gui was best to create a graphic, now I'm thinking I should have just used an image file instead!

Posted (edited)

Thanks, I've posted it in Bug reports so we shall see.

You know I thought that creating a litte dot which changes from Green to Red and moves with the Gui was best to create a graphic, now I'm thinking I should have just used an image file instead!

Use icons. They can be simply compiled into EXE and used from there.

Look at #AutoIt3Wrapper_Res_Icon_Add directive http://www.autoitscript.com/autoit3/scite/...oIt3Wrapper.htm

Edited by Zedna

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
×
×
  • Create New...