JScript Posted June 16, 2014 Share Posted June 16, 2014 (edited) Hello friends!Has anyone ever done something like this window in slide format?I'm lousy at math calculations and I do not have much experience in such windows, who can give me a hand I am grateful! JS Edited June 16, 2014 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 16, 2014 Moderators Share Posted June 16, 2014 JScript,You could use my GUIExtender UDF to do something like this:expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <GUIExtender.au3> $hGUI = GUICreate("Test", 500, 500) GUISetState() $hMenu = GUICreate("Menu", 480, 40, 10, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) _GUIExtender_Init($hMenu) $iSection = _GUIExtender_Section_Start($hMenu, 0, 30) $cButton_1 = GUICtrlCreateButton("Button 1", 0, 0, 80, 30) $cButton_2 = GUICtrlCreateButton("Button 2", 80, 0, 80, 30) $cButton_3 = GUICtrlCreateButton("Button 3", 160, 0, 80, 30) $cButton_4 = GUICtrlCreateButton("Button 4", 240, 0, 80, 30) $cButton_5 = GUICtrlCreateButton("Button 5", 320, 0, 80, 30) $cButton_6 = GUICtrlCreateButton("Button 6", 400, 0, 80, 30) _GUIExtender_Section_End($hMenu) _GUIExtender_Section_Start($hMenu, 30, 10) _GUIExtender_Section_Action($hMenu, $iSection, "", "", 0, 30, 480, 10, 1) _GUIExtender_Section_End($hMenu) _GUIExtender_Section_Extend($hMenu, $iSection, False) GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $cButton_1 To $cButton_6 MsgBox($MB_SYSTEMMODAL, "Clicked", "You clicked Button " & $iMsg - $cButton_1 + 1) EndSwitch _GUIExtender_Action($hMenu, $iMsg) WEndAny use? M23 JScript 1 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...
AdmiralAlkex Posted June 16, 2014 Share Posted June 16, 2014 That looks more like graphical elements than an actual window. After you have learned how to draw boxes/lines/text in GDI+ (or however you decide to do it) then the math will be easy. JScript 1 .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
JScript Posted June 16, 2014 Author Share Posted June 16, 2014 @Melba23It is an excellent option friend! I'll implement here, but I believe it is something with GDI, anyway I'll test your code, thanks!@AdmiralAlkexYes, I think it is too, but not very well dominate this area, if you have examples in which I can adapt, or something.Thanks for the attention of you friends,JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 16, 2014 Moderators Share Posted June 16, 2014 Just out of curiosity, is this just an example or are you actually trying to manipulate TeamViewer? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
JScript Posted June 16, 2014 Author Share Posted June 16, 2014 @JLogan3o13Hello, is just one example of demonstration, with that I will improve the look of my project '?do=embed' frameborder='0' data-embedContent>>JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
JScript Posted June 17, 2014 Author Share Posted June 17, 2014 (edited) Friends, I saw an example in the help file and made some minor changes in the creation of the star, but did not quite understand the dynamics of the function. #include <GUIConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> ; Create GUI Local $hForm = GUICreate('Test ' & StringReplace(@ScriptName, '.au3', '()'), 500, 475, -1, -1, $WS_POPUP, $WS_EX_TOPMOST) Local $idButton = GUICtrlCreateButton('Exit', 215, 10, 70, 23) GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST') GUISetBkColor(0xC0C0C0) ; Create polygonal region and set it to the window Local $aPoint[10][2] = [[0, 0],[0, 0],[0, 100],[0, 0],[0, 0],[500, 0],[500, 60],[0, 60],[0, 0],[0, 0]] Local $hRgn = _WinAPI_CreatePolygonRgn($aPoint) _WinAPI_SetWindowRgn($hForm, $hRgn, 0) GUISetState(@SW_SHOW) Do Until GUIGetMsg() = $idButton Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam Return $HTCAPTION EndFunc ;==>WM_NCHITTESTIf anyone knows how to model the example above...JS Edited June 17, 2014 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
taietel Posted June 17, 2014 Share Posted June 17, 2014 (edited) expandcollapse popup#include <GUIConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #cs <----------------------- $iW -----------------------> | | $iH | | - <--------- $w -------><--- $r ---> | | $p | | - #ce $iW=500 $iH=200 $w=90 $p=25 $r=20 $iFont=16 $bExpand=True ; Create GUI Local $hForm = GUICreate("Test", $iW, $iH+$p, (@DesktopWidth-$iW+$w+$r)/2, -$iH, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0xdedede) $hExit = GUICtrlCreateLabel("r", $iW-$r-$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings") GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1,0) $hCfg = GUICtrlCreateLabel("@", $iW-$r-2*$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings") GUICtrlSetCursor(-1,0) GUICtrlSetColor(-1, 0x505050) $hExpand = GUICtrlCreateLabel("6", $iW-$r-3.5*$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings") GUICtrlSetCursor(-1,0) GUICtrlSetColor(-1, 0x505050) Local $aPoint[9][2] = [[0, 0],[$iW, 0],[$iW, $iH],[$iW-$r,$iH],[$iW-$r-$p/3,$iH+$p],[$iW-$r-$w,$iH+$p],[$iW-$r-$w-$p/3,$iH],[0, $iH],[0, 0]] Local $hRgn = _WinAPI_CreatePolygonRgn($aPoint) _WinAPI_SetWindowRgn($hForm, $hRgn, 0) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $hExit Exit Case $hCfg MsgBox(0,"","You won! What?...") Case $hExpand If $bExpand Then GUICtrlSetData($hExpand,"5") WinMove($hForm, "", (@DesktopWidth-$iW+$w+$r)/2, 0, $iW, $iH+$p,5) $bExpand=False Else GUICtrlSetData($hExpand,"6") WinMove($hForm, "", (@DesktopWidth-$iW+$w+$r)/2, -$iH, $iW, $iH+$p,5) $bExpand=True EndIf EndSwitch WEnd Try this, see if it fits. (modified: made some changes) Edited June 17, 2014 by taietel JScript 1 Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
JScript Posted June 17, 2014 Author Share Posted June 17, 2014 @taietel Excellent friend, is this basically what I wanted!!! This "graphic" explanation helped me understand the workings of _WinAPI_CreatePolygonRgn() function: #cs <----------------------- $iW -----------------------> | | $iH | | - <--------- $w -------><--- $r ---> | | $p | | - #ce I'll do some tests, Thanks mate! JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
JScript Posted June 17, 2014 Author Share Posted June 17, 2014 (edited) Here's a test I did in my program: One question: How to round the edges? There is a possibility for a shadow? JS Edited June 17, 2014 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
taietel Posted June 18, 2014 Share Posted June 18, 2014 (edited) Try now: expandcollapse popup#include <GUIConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> ;coded by taietel #cs <----------------------- $iW -----------------------> | | $iH | | - <--------- $w -------><--- $r ---> | | $p | | - #ce $iW=500 $iFont=12 $iH=$iFont+4+20 $bExpand=True $iNoIcnsExpand=3 $w=$iNoIcnsExpand*($iFont+4+10) $p=25 $r=20 $iDelay=2 $iIcnExit="r" $iIcnCfg="@" $iIcnInfo="i" $iIcnUp="5" $iIcnDown="6" $iIcnSep="|" $iIcnChk="a" $iIcnFull="1" ; Create GUI Local $hForm = GUICreate("Test", $iW, $iH+$p, (@DesktopWidth-$iW+$w+$r)/2, -$iH, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0xdedede) ;------- Put some stuff on GUI ---------- $hExit = GUICtrlCreateLabel($iIcnExit, 5, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1,0) GUICtrlSetTip(-1,"Exit") GUICtrlCreateLabel($iIcnSep, 5+$iFont+4, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x909090) $hSomeStuff = GUICtrlCreateLabel($iIcnCfg, 5+2*($iFont+4), $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x505050) $hSomeStuff_l=GUICtrlCreateLabel("Some stuff", 5+3*($iFont+4), $iH-($iFont+4)-10, 80, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Arial",5) GUICtrlSetColor(-1, 0x505050) $hSomeStuffA = GUICtrlCreateLabel($iIcnDown, 5+3*($iFont+4)+80, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont-2, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1,0) $DummyMenu = GUICtrlCreateDummy() $hContextMenu = GUICtrlCreateContextMenu($DummyMenu) $mnuSomeStuff = GUICtrlCreateMenuItem("Some Item", $hContextMenu) $mnuExit = GUICtrlCreateMenuItem("Exit", $hContextMenu) GUICtrlCreateLabel($iIcnSep, 5+4*($iFont+4)+80-5, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x909090) GUICtrlCreateLabel($iIcnInfo, 5+5*($iFont+4)+80, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x505050) $hAbout = GUICtrlCreateLabel("About", 5+6*($iFont+4)+80, $iH-($iFont+4)-10, 60, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Arial",5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1,0) GUICtrlSetTip(-1,"About this program...") GUICtrlCreateLabel($iIcnSep, 5+6*($iFont+4)+80+60, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x909090) ;------- end some stuff on GUI ---------- $hExpand = GUICtrlCreateLabel($iIcnDown, $iW-$r-$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1,0) GUICtrlSetTip(-1,"Expand") GUICtrlCreateLabel($iIcnSep, $iW-$r-2*$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x909090) $hFullScreen = GUICtrlCreateLabel($iIcnFull, $iW-$r-3*$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetCursor(-1,0) GUICtrlSetTip(-1,"Full Screen") GUICtrlSetColor(-1, 0x505050) Local $hRgn = _WinAPI_CreateRectRgn (0, 0, $iW-1, $iH/2) Local $hRgn1 = _WinAPI_CreateRoundRectRgn(0, 0, $iW, $iH, 7, 7) Local $hRgn2 = _WinAPI_CreateRoundRectRgn($iW-$r-$w, 2, $iW-$r, $iH+$p, 7, 7) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn1, $RGN_OR) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn2, $RGN_OR) _WinAPI_DeleteObject($hRgn1) _WinAPI_DeleteObject($hRgn2) _WinAPI_SetWindowRgn($hForm, $hRgn, 1) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $hExit, $mnuExit Exit Case $hFullScreen MsgBox(0,"","Here you'll have to put the code for full screen mode.") Case $hAbout MsgBox(0,"","Here you'll have to put the code for About message.") Case $hExpand If $bExpand Then GUICtrlSetData($hExpand,$iIcnUp) WinMove($hForm, "", (@DesktopWidth-$iW+$w+$r)/2, 0, $iW, $iH+$p,$iDelay) GUICtrlSetTip($hExpand,"Retract") $bExpand=False Else GUICtrlSetData($hExpand,$iIcnDown) WinMove($hForm, "", (@DesktopWidth-$iW+$w+$r)/2, -$iH, $iW, $iH+$p,$iDelay) GUICtrlSetTip($hExpand,"Expand") $bExpand=True EndIf Case $hSomeStuffA, $hSomeStuff_l ShowMenu($hForm, $hContextMenu, $hSomeStuff) EndSwitch WEnd Func ShowMenu($hWnd, $nContextID, $nContextControlID, $iMouse=0) Local $hMenu = GUICtrlGetHandle($nContextID) Local $iCtrlPos = ControlGetPos($hWnd, "", $nContextControlID) Local $X = $iCtrlPos[0] Local $Y = $iCtrlPos[1] + $iCtrlPos[3] ClientToScreen($hWnd, $X, $Y) If $iMouse Then $X = MouseGetPos(0) $Y = MouseGetPos(1) EndIf DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $X, "int", $Y, "hwnd", $hWnd, "ptr", 0) EndFunc ; Convert the client (GUI) coordinates to screen (desktop) coordinates Func ClientToScreen($hWnd, ByRef $x, ByRef $y) Local $stPoint = DllStructCreate("int;int") DllStructSetData($stPoint, 1, $x) DllStructSetData($stPoint, 2, $y) DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint)) $x = DllStructGetData($stPoint, 1) $y = DllStructGetData($stPoint, 2) ; release Struct not really needed as it is a local $stPoint = 0 EndFunc Edited June 18, 2014 by taietel mLipok and JScript 2 Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
mLipok Posted June 18, 2014 Share Posted June 18, 2014 I following this thread and I would say:This is fantastic. mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
mLipok Posted June 18, 2014 Share Posted June 18, 2014 (edited) I notcie One issue or this is only my question: There is a Combo like button "Some Sutff" Whether it is posibble to open combo list after clicking in "Some stuff" text, not only in the arrow symbol ? EDIT: oh.. I see About button works quite similar to my requests. Edited June 18, 2014 by mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
JScript Posted June 18, 2014 Author Share Posted June 18, 2014 @taietel Hello friend!First, thanks for your help, the result was better than I thought, was excellent!I noticed you did not use the function of polygons, so I assume that the effect shown below is no longer possible: JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
Solution taietel Posted June 18, 2014 Solution Share Posted June 18, 2014 I noticed you did not use the function of polygons, so I assume that the effect shown below is no longer possible: JScript, try now: expandcollapse popup#include <GUIConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> ;coded by taietel _SlideWindow() Func _SlideWindow() Local $iW = 600, $iFont = 12, $iH = $iFont + 4 + 20, $bExpand = True, $iNoIcnsExpand = 3, $w = $iNoIcnsExpand * ($iFont + 4 + 10), $p = 25, $r = 25, $iDelay = 2 Local $iIcnExit = "r", $iIcnCfg = "@", $iIcnInfo = "i", $iIcnUp = "5", $iIcnDown = "6", $iIcnSep = "|", $iIcnChk = "a", $iIcnFull = "1" ; Create GUI Local $hForm = GUICreate("Test", $iW, $iH + $p, (@DesktopWidth - $iW + $w + $r) / 2, -$iH, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0xdedede) ;------- Put some stuff on GUI ---------- Local $hExit = GUICtrlCreateLabel($iIcnExit, 5, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1, 0) GUICtrlSetTip(-1, "Exit") GUICtrlCreateLabel($iIcnSep, 5 + $iFont + 4, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x909090) Local $hSomeStuff = GUICtrlCreateLabel($iIcnCfg, 5 + 2 * ($iFont + 4), $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x505050) Local $hSomeStuff_l = GUICtrlCreateLabel("Some stuff", 5 + 3 * ($iFont + 4), $iH - ($iFont + 4) - 10, 80, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Arial", 5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetTip(-1, "Click for menu") GUICtrlSetCursor(-1, 0) Local $hSomeStuffA = GUICtrlCreateLabel($iIcnDown, 5 + 3 * ($iFont + 4) + 80, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont - 2, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetTip(-1, "Click for menu") GUICtrlSetCursor(-1, 0) Local $DummyMenu = GUICtrlCreateDummy() Local $hContextMenu = GUICtrlCreateContextMenu($DummyMenu) Local $mnuSomeStuff = GUICtrlCreateMenuItem("Some Item", $hContextMenu) Local $mnuExit = GUICtrlCreateMenuItem("Exit", $hContextMenu) GUICtrlCreateLabel($iIcnSep, 5 + 4 * ($iFont + 4) + 80 - 5, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x909090) GUICtrlCreateLabel($iIcnInfo, 5 + 5 * ($iFont + 4) + 80, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x505050) Local $hAbout = GUICtrlCreateLabel("About", 5 + 6 * ($iFont + 4) + 80, $iH - ($iFont + 4) - 10, 60, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Arial", 5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1, 0) GUICtrlSetTip(-1, "About this program...") GUICtrlCreateLabel($iIcnSep, 5 + 6 * ($iFont + 4) + 80 + 60, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x909090) ;------- end some stuff on GUI ---------- Local $hExpand = GUICtrlCreateLabel($iIcnDown, $iW - $r - $w / 4 - ($iFont + 4) / 2, $iH + ($p - ($iFont + 4)) / 2, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1, 0) GUICtrlSetTip(-1, "Expand") GUICtrlCreateLabel($iIcnSep, $iW - $r - 2 * $w / 4 - ($iFont + 4) / 2, $iH + ($p - ($iFont + 4)) / 2, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x909090) Local $hFullScreen = GUICtrlCreateLabel($iIcnFull, $iW - $r - 3 * $w / 4 - ($iFont + 4) / 2, $iH + ($p - ($iFont + 4)) / 2, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetCursor(-1, 0) GUICtrlSetTip(-1, "Full Screen") GUICtrlSetColor(-1, 0x505050) Local $hRgn = _WinAPI_CreateRectRgn(0, 0, $iW - 1, $iH / 2) Local $hRgn1 = _WinAPI_CreateRoundRectRgn(0, 0, $iW, $iH, 7, 7) Local $hRgn2 = _WinAPI_CreateRoundRectRgn($iW - $r - $w, 2, $iW - $r, $iH + $p, 7, 7) Local $hRgn3 = _WinAPI_CreateRectRgn($iW - $r - $w - 5, 2, $iW - $r - $w, $iH + $p) Local $aPointl[3][2] = [[$iW - $r - $w - 5, $iH - 1], [$iW - $r - $w, $iH + $p], [$iW - $r - $w, $iH - 1]] Local $hRgn3 = _WinAPI_CreatePolygonRgn($aPointl) Local $aPointr[3][2] = [[$iW - $r + 5, $iH - 1], [$iW - $r - 2, $iH + $p - 1], [$iW - $r - 1, $iH - 1]] Local $hRgn4 = _WinAPI_CreatePolygonRgn($aPointr) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn1, $RGN_OR) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn2, $RGN_OR) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn3, $RGN_OR) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn4, $RGN_OR) _WinAPI_DeleteObject($hRgn1) _WinAPI_DeleteObject($hRgn2) _WinAPI_DeleteObject($hRgn3) _WinAPI_DeleteObject($hRgn4) _WinAPI_SetWindowRgn($hForm, $hRgn, 1) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $hExit, $mnuExit Exit Case $hFullScreen MsgBox(0, "", "Here you'll have to put the code for full screen mode.") Case $mnuSomeStuff MsgBox(0,"","stuff...") Case $hAbout MsgBox(0, "", "Here you'll have to put the code for About message.") Case $hExpand If $bExpand Then GUICtrlSetData($hExpand, $iIcnUp) WinMove($hForm, "", (@DesktopWidth - $iW + $w + $r) / 2, 0, $iW, $iH + $p, $iDelay) GUICtrlSetTip($hExpand, "Retract") $bExpand = False Else GUICtrlSetData($hExpand, $iIcnDown) WinMove($hForm, "", (@DesktopWidth - $iW + $w + $r) / 2, -$iH, $iW, $iH + $p, $iDelay) GUICtrlSetTip($hExpand, "Expand") $bExpand = True EndIf Case $hSomeStuffA, $hSomeStuff_l ShowMenu($hForm, $hContextMenu, $hSomeStuff) EndSwitch WEnd EndFunc ;==>_test Func ShowMenu($hWnd, $nContextID, $nContextControlID, $iMouse = 0) Local $hMenu = GUICtrlGetHandle($nContextID) Local $iCtrlPos = ControlGetPos($hWnd, "", $nContextControlID) Local $X = $iCtrlPos[0] Local $Y = $iCtrlPos[1] + $iCtrlPos[3] ClientToScreen($hWnd, $X, $Y) If $iMouse Then $X = MouseGetPos(0) $Y = MouseGetPos(1) EndIf DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $X, "int", $Y, "hwnd", $hWnd, "ptr", 0) EndFunc ;==>ShowMenu ; Convert the client (GUI) coordinates to screen (desktop) coordinates Func ClientToScreen($hWnd, ByRef $X, ByRef $Y) Local $stPoint = DllStructCreate("int;int") DllStructSetData($stPoint, 1, $X) DllStructSetData($stPoint, 2, $Y) DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint)) $X = DllStructGetData($stPoint, 1) $Y = DllStructGetData($stPoint, 2) ; release Struct not really needed as it is a local $stPoint = 0 EndFunc ;==>ClientToScreen JScript 1 Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
JScript Posted June 18, 2014 Author Share Posted June 18, 2014 Perfect friend!Thanks for your great help,JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
JScript Posted June 18, 2014 Author Share Posted June 18, 2014 This snippet caught my attention: Local $hRgn3 = _WinAPI_CreateRectRgn($iW - $r - $w - 5, 2, $iW - $r - $w, $iH + $p) Local $hRgn3 = _WinAPI_CreatePolygonRgn($aPointl) The variable has been redefined... JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
UEZ Posted June 19, 2014 Share Posted June 19, 2014 (edited) @taietel: nice to see you active again! Btw, nice code. One thing bothered me. When you click on the arrow that the GUI moves down the controls are flickering. Using GUISetState(@SW_LOCK, $hForm) disables flickering:Case $hExpand If $bExpand Then GUICtrlSetData($hExpand, $iIcnUp) GUISetState(@SW_LOCK, $hForm) WinMove($hForm, "", (@DesktopWidth - $iW + $w + $r) / 2, 0, $iW, $iH + $p, $iDelay) GUISetState(@SW_UNLOCK, $hForm) GUICtrlSetTip($hExpand, "Retract") $bExpand = False Else GUICtrlSetData($hExpand, $iIcnDown) WinMove($hForm, "", (@DesktopWidth - $iW + $w + $r) / 2, -$iH, $iW, $iH + $p, $iDelay) GUICtrlSetTip($hExpand, "Expand") $bExpand = True EndIfBr,UEZ Edited June 19, 2014 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
JScript Posted June 19, 2014 Author Share Posted June 19, 2014 @UEZ In this way is much better: Case $hExpand If $bExpand Then GUICtrlSetData($hExpand, $iIcnUp) For $i = -$iH To 0 Step $iDelay _WinAPI_MoveWindow($hForm, (@DesktopWidth - $iW) / 2, $i, $iW, $iH + $p) Sleep(10) Next GUICtrlSetTip($hExpand, "Retract") $bExpand = False Else GUICtrlSetData($hExpand, $iIcnDown) For $i = 0 To -$iH Step -$iDelay _WinAPI_MoveWindow($hForm, (@DesktopWidth - $iW) / 2, $i, $iW, $iH + $p) Sleep(10) Next GUICtrlSetTip($hExpand, "Expand") $bExpand = True EndIf JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! 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