Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/06/2016 in all areas

  1. You need to decide to which side of the GUI a control needs to stick to. As an example I modified Label, Combo Button0: #include <ButtonConstants.au3> #include <ColorConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> Global $g_hMainGUI = GUICreate("Test GUI", 500, 316, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetBkColor($COLOR_WHITE, $g_hMainGUI) GUICtrlCreateGroup("Box 1", 6, 2, 488, 197) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUICtrlCreateLabel("Label", 9, 20, 67, 15) GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP)) GUICtrlCreateCombo("", 77, 14, 334, 21, $CBS_DROPDOWNLIST) GUICtrlSetResizing(-1, BitOr($GUI_DOCKLEFT, $GUI_DOCKWIDTH)) GUICtrlCreateButton("Button 0", 415, 13, 74, 23) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT) GUICtrlCreateListView("Col 1|Col 2|Col 3", 12, 42, 476, 149, $LVS_SINGLESEL, BitOR($LVS_EX_FULLROWSELECT, $WS_EX_CLIENTEDGE)) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUICtrlCreateGroup("Box 2", 6, 199, 253, 112) ;GUICtrlSetResizing(-1, $GUI_DOCKHEIGHT) GUICtrlCreateButton("Button 1", 11, 214, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 2", 11, 245, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 3", 133, 245, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 4", 133, 214, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 5", 11, 276, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 6", 133, 276, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateGroup("Box 3", 264, 199, 230, 112) ;GUICtrlSetResizing(-1, $GUI_DOCKHEIGHT) GUICtrlCreateButton("Button 7", 269, 214, 220, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 8", 269, 245, 220, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 9", 269, 276, 220, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUISetState() Local $nMsg = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($g_hMainGUI)
    1 point
  2. TheDcoder, Is this what you want? The boxes stay around the control groupings and the label, combo and button stay at the top: #include <ButtonConstants.au3> #include <ColorConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> Global $g_hMainGUI = GUICreate("Test GUI", 500, 316, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetBkColor($COLOR_WHITE, $g_hMainGUI) GUICtrlCreateGroup("Box 1", 6, 2, 488, 197) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUICtrlCreateLabel("Label", 9, 20, 67, 15) GUICtrlSetBkColor(-1, 0xFFCCCC) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKSIZE) GUICtrlCreateCombo("", 77, 14, 334, 21, $CBS_DROPDOWNLIST) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKSIZE + $GUI_DOCKVCENTER) GUICtrlCreateButton("Button 0", 415, 13, 74, 23) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKRIGHT + $GUI_DOCKSIZE) GUICtrlCreatelistView("Col 1|Col 2|Col 3", 12, 42, 476, 149, $LVS_SINGLESEL, BitOR($LVS_EX_FULLROWSELECT, $WS_EX_CLIENTEDGE)) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUICtrlCreateGroup("Box 2", 6, 199, 253, 112) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKHEIGHT + $GUI_DOCKBOTTOM) GUICtrlCreateButton("Button 1", 11, 214, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 2", 11, 245, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 3", 133, 245, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 4", 133, 214, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 5", 11, 276, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 6", 133, 276, 121, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateGroup("Box 3", 264, 199, 230, 112) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT + $GUI_DOCKHEIGHT + $GUI_DOCKBOTTOM) GUICtrlCreateButton("Button 7", 269, 214, 220, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 8", 269, 245, 220, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUICtrlCreateButton("Button 9", 269, 276, 220, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR) GUISetState() Local $nMsg = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($g_hMainGUI) Note you can use simple addition for the resizing constants. M23
    1 point
  3. 1. $GUI_DOCKTOP 2. Idk what you mean by prevent expansion, it sounds like you don't want it to resize so use $GUI_DOCKALL
    1 point
  4. @TheSaint, it's all here >> https://www.autoitscript.com/wiki/Best_coding_practices
    1 point
  5. [NEW VERSION] - 6 Feb 16 An important update this time with lots of new functions: Added: ListView contents can now be saved to and reloaded from file - the new functions _GUIListViewEx_Save/LoadListView allow you save the content, the column headers, any checkbox states and (see below) any user colour settings. The current _GUIListViewEx_Insert/Delete functions act on the selected items within the active ListView (activaton being either by clicking or programatically) - 2 new functions _GUIListViewEx_Insert/DeleteSpec allow the user to programatically specify the ListView and row/col to add/remove. In the same manner as the functions above add/remove rows, 4 new functions (_GUIListViewEx_Insert/DeleteCol & _GUIListViewEx_Insert/DeleteColSpec) allow the user to add/remove columns. If the containing GUI was closed using the titlebar [X] while item editing was taking place, it sometimes took more then one click to get a response. A new handler _GUIListViewEx_WM_SYSCOMMAND_Handler has been added to intercept the closure message and act more quickly. This handler only manages this specific task and is not involved for any other UDF functionality And now the most exciting part of this update - colour! Users can now colour individual items with in the ListView using the _GUIListViewEx_SetColour function. The text and background can be coloured individually or together and can be reset to the default colours if required. The ListView can also be created with coloured elements by creating a suitable array and using the _GUIListViewEx_LoadColour function. Note that if colours are set, using the load/save functions mentioned above will also save/load the colours. The UDF now logs the row and column of the last right-click so that a context menu can be used to trigger actions - the index of the last righ-clicked ListView and the specific row/column can be obtained via the _GUIListViewEx_ContextPos function. Changed: All "Internal Use Only" functions now have a leading double-underscore - so if you have been using any of them in your scripts (which I hope is not the case) you will have to add an underscore to the name. There is also a new example script (Example_6) which shows all these new functions in use. The LH native ListView can have rows and columns added/removed using both the old and new functions and has a context menu to allow for colour selection. The contents of this listView can be mirrored to the RH UDF-created ListView, where the colours of any item can be changed programatically. Thanks to error471 (colour) and Omega19 (specific Insert/Delete) for the feature requests. New files in the zip in the first post - enjoy! M23
    1 point
  6. jchd

    Why #forceref?

    Yes it does. Else all scripts using this and that standard include and adhering to recommended coding practices would report warnings. That would cause dozens of complaints a day. Would also make stripping unusable (breaking correct scripts).
    1 point
  7. JohnOne

    Why #forceref?

    The question was why does it need to exist, and the short answer is, it does not need to exist.
    1 point
  8. Just like me. So no worry you are not alone mLipok
    1 point
  9. This might not seem so spectacular, but I'm proud of it so I posted it.. Here is a simple graphic and it will be represented in just letters in small font.. but the thing to note is we have a small amount of data to start with, there are no external files. The functions make 4 graphics out of one, and if you wanted, you could get 8, but you'd have to figure out how to rotate it at a 45 degree angle.. Which I might do later.. The initial graphic can be gained with a pixel mapping method. So my next move is to use the GuiCtrlCreateGraphic functions to make a similar graphics with color Where each color can be represented with a single character, and we'll just have a square map to start with and spin it around.. It would make more sense to use an gif, I know, but I can't figure out how to put an animated gif in my gui .. lol .. and I've already invested too much time here to go back! $begin = TimerInit() $newchar = "" $grspeed = 200 ; ms pause between changing pics $guifont = "Courier New" ;~ $guifont = "Webdings" ; we start with a small graphic which can be created with an Global $grtxto[4] $grtxto[0] = "" & _ " @@@@@ "& @CRLF & _ " @@@@@@@@@ "& @CRLF & _ " @@@ "& @CRLF & _ " @@@ "& @CRLF & _ " @@ "& @CRLF & _ " @@"& @CRLF & _ " @@"& @CRLF & _ " @@"& @CRLF & _ " @@"& @CRLF & _ "@@@@@ @@"& @CRLF & _ "@@@@ @@ "& @CRLF & _ "@@@ @@@ "& @CRLF & _ "@@@@@ @@@ "& @CRLF & _ "@ @@@@@@@@@ "& @CRLF & _ " @@@@@ " If $newchar <> "" Then $grtxto[0] = StringReplace($grtxto[0], "@", $newchar) $grtxto[1] = RotateLeft($grtxto[0]) $grtxto[2] = _StringRev($grtxto[0]) $grtxto[3] = _StringRev($grtxto[1]) Func RotateLeft($s) $a = StringSplit($s, @crlf, 1) $o = '' $sl = StringLen($a[1]) dim $ao[$sl] For $i = $a[0] to 1 Step -1 $t = StringSplit($a[$i],'') For $ii = 0 to $sl-1 $ao[$ii] &= $t[$ii+1] Next Next For $b in $ao $o &= @CRLF & $b Next ;~ ; origional method; smaller, but more dangerous.. ;~ For $l = 1 to $sl ;~ $o &= @CRLF ;~ For $i = $a[0]-1 to 1 step -1 ;~ $o &= StringMid($a[$i], $l, 1) ;~ Next ;~ Next Return StringMid($o,3) EndFunc Func _StringRev($s) $o = '' For $i = StringLen($s) to 1 Step -1 $o &= StringMid($s,$i,1) Next Return $o EndFunc ; -- gui stuff Opt("GUICloseOnESC",1) Opt("GUIOnEventMode", 1) $gui = GUICreate("graphtest", 200,200) GUISetBkColor(0x000000) $graph = GUICtrlCreateLabel("",20,20,50,50) GUICtrlSetFont(-1, 1,600,-1,$guifont) GUICtrlSetColor(-1, 0xffffff) GUICtrlSetTip(-1, "is this tooltip flashing?"&@CRLF&"call 1-800-sry-imnoob..") $timerinfo = GUICtrlCreateLabel("",10,180,150) GUICtrlSetColor(-1, 0xffffff) GUISetState() GUISetOnEvent(-3, "_exit") HotKeySet("{esc}","_exit") Global $cct = 0 GUICtrlSetData($timerinfo, "Done in " & TimerDiff($begin)) While 1 GUICtrlSetData($graph, $grtxto[$cct]) $cct +=1 If $cct > 3 Then $cct = 0 sleep($grspeed) WEnd Func _exit() Exit EndFuncoÝ÷ Øw«{l¶©¥ëa¡Ò.±çm¢­¶¬¶©'"·l~º&']r^±ì^r^Â'!Á«&i×­¡·¯z¼jËS+(è¬~Û§$jwp+^#¥z0©¢w­¢­{µÊ%¢¶§vØ^·©®nqëayÊ%¢¼"¶.¶-ßÛ ­ªaÇîËb¢{ºÚ"µÍÛY Ì BÎÎÈØZ][ÙH]HÝXÈXYIÌÌÎÂÛØ[ ÌÍÙXY×Ù[HH[SÜ[ ][ÝÛØÜ ][ÝËJBÎÎÔØÜY[V ÌBVNÎBÎÎßÎÎÎÔØÜY[V VN ËKHÙH]HÝÞ[X]HÛÛÜÈÛH]]Ò]Ú[ÝÈ[ÈÛÛÌÍÞÝHÎBÌÍÛX^HH ÌÍÞÝH ÌBÌÍÛX^H [H ÌÍÝ[ÉÌÍÛX^KIÌÍÞÝBÜ ÌÍÚHHÈXÝ[ ÌÍÝ[ KLBIÌÍÝ[ÉÌÍÚWOI][ÝÐ ][ÝÂ^Ü ÌÍÚHH ÌÍÞÝÈ ÌÍÛX^ ÌÍÜÝH ÌÍÞÝBIÌÍÞH ÌÍÝ[Ú[HBÔ^[ÙXÚ YÜYÚÝÛKÛÛÜËÚYK]X][ÛHËÝWH B ÌÍÞÉÌÍØÌWKIÌÍÞÝHH ][ÝÈ ][Ý ÌÍÜÝH ÌÍØÌWJÌBY ÌÍÜÝH ÌÍÛX^H[^]ÛÜUÑ[Ù][X ÌÍÞ B^[PÛÜÙJ ÌÍÙXY×Ù[JBÙÐÞ ÌÎNÉÌÎNË ÌÎNÙÛIÌÎNÊB[ÈÙ][X ÌÍØBBSØØ[ ÌÍÞH ][ÝÉ][ÝÂBQÜ ÌÍÚHHÈPÝ[ ÌÍØKLBBBBIÌÍÞ [ÏH ÌÍØÉÌÍÚWBBS^[UÜ]S[J ÌÍÙXY×Ù[K ÌÍÞ B[[Â
    1 point
×
×
  • Create New...