auto-it-tous Posted May 11, 2021 Posted May 11, 2021 hi this is a nice udf but..it will make some error for GUICtrlSlider function after mouse to click the slider the slider thumbmark will not display. t think ....may be you must to write the slider function of your udf. HA..HA..HA.. -Everything are starting by the dreams.-Everybody is working with computer.-Everydays will auto because we need it. Come on..Let's doing...AUTOIT....^^"..just a little idea..a little A.D.
Parsix Posted November 12, 2021 Posted November 12, 2021 On 10/18/2017 at 5:46 PM, NHD said: Hi, Give you some solution for tab control from me. FlatTab.au3 expandcollapse popup#include-once #include <GDIPlus.au3> #include <Array.au3> #include "GUICtrlOnHover.au3" Global $FlatUIColor = DllStructCreate("struct;float back;float fore;float frame;endstruct;") $FlatUIColor.back = 0x3C4649 $FlatUIColor.fore = 0x23A86D ;0x3498db $FlatUIColor.frame = 0x2D2F31 Global Const $tObjTabEx = "hwnd hwnd;byte ctrl;byte ctab;" & _ "byte count;byte current;int next;" & _ "int width;int x;int y;" Global Const $tObjTabBtnEx = "byte ctrl;byte ctab;byte idtab;" & _ "wchar text[255];" Global $____aTabList[1] = [0] Global $____aTabBtnList[1] = [0] Func FlatTab_Create($hWnd, $Left, $Top, $Width, $Height) GUISwitch($hWnd) Local $oObj = DllStructCreate($tObjTabEx) _ArrayAdd($____aTabList, $oObj) $____aTabList[0] += 1 $oObj.hwnd = $hWnd $oObj.ctrl = GUICtrlCreatePic("", $Left, $Top+25, $Width, $Height-50) GUICtrlSetResizing($oObj.ctrl, 802) GUICtrlSetState($oObj.ctrl, 128) $oObj.ctab = GUICtrlCreateTab(-99, -99, 1, 1) GUICtrlSetState($oObj.ctab, 128) Local $aBmp = _GDIPlus_BitmapCreateFromScan0($Width, $Height-50) Local $hGfx = _GDIPlus_ImageGetGraphicsContext($aBmp) Local $hPen = _GDIPlus_PenCreate($FlatUIColor.frame+0xFF000000, 4) Local $hBrush = _GDIPlus_BrushCreateSolid($FlatUIColor.frame+0xFF000000) _GDIPlus_GraphicsDrawRect($hGfx, 0, 0, $Width, $Height-50, $hPen) _GDIPlus_GraphicsFillRect($hGfx, 0, 0, $Width, $Height-50, $hBrush) _GDIPlus_GraphicsClear($hGfx, $FlatUIColor.frame+0xFF000000) Local $hBmp = _GDIPlus_BitmapCreateDIBFromBitmap($aBmp) _GDIPlus_BitmapDispose($aBmp) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_PenDispose($hPen) _WinAPI_DeleteObject(GUICtrlSendMsg($oObj.ctrl, 0x0172, 0, $hBmp)) _WinAPI_DeleteObject($hBmp) $oObj.width = $Width $oObj.x = $Left $oObj.y = $Top $oObj.current = "" $oObj.count = 0 $oObj.next = $Left Return $oObj EndFunc Func FlatTab_AddTab($Ctrl, $Text) GUISwitch($Ctrl.hwnd) GUICtrlCreateTabItem("") Local $oObj = DllStructCreate($tObjTabBtnEx) _ArrayAdd($____aTabBtnList, $oObj) $____aTabBtnList[0] += 1 $oObj.ctrl = GUICtrlCreatePic("", $Ctrl.next, $Ctrl.y, 80, 25) GUICtrlSetResizing($oObj.ctrl, 802) _GUICtrl_OnHoverRegister($oObj.ctrl, 'FlatTab_EventHover', 'FlatTab_EventHover', 'FlatTab_EventClick', 'FlatTab_EventClick') $oObj.count +=1 $oObj.idtab = GUICtrlCreateTabItem($oObj.count) $oObj.text = $Text If $Ctrl.current <> "" Then Local $Prev = FlatTab_GetObjTabBtnFromCtrl($Ctrl.current) FlatTab_Draw($Prev.ctrl, $Prev.text, 0xFFFFFFFF, $FlatUIColor.fore+0xFF000000) EndIf FlatTab_Draw($oObj.ctrl, $Text, 0xFFFFFFFF, $FlatUIColor.frame+0xFF000000) $Ctrl.current = $oObj.ctrl $oObj.ctab = $Ctrl.ctab $Ctrl.next += 80 GUICtrlSetState($oObj.idtab, 16) Return $oObj.idtab EndFunc Func FlatTab_EventHover($Ctrl, $Mode) Local $Obj1 = FlatTab_GetObjTabFromCtrl($Ctrl) If $Obj1.current = $Ctrl Then Return Local $Obj2 = FlatTab_GetObjTabBtnFromCtrl($Ctrl) Switch $Mode Case 1 FlatTab_Draw($Ctrl, $Obj2.text, 0xFFFFFFFF, $FlatUIColor.fore+0xFF151515) Case 2 FlatTab_Draw($Ctrl, $Obj2.text, 0xFFFFFFFF, $FlatUIColor.fore+0xFF000000) EndSwitch EndFunc Func FlatTab_EventClick($Ctrl, $Mode) If $Mode = 2 Then Local $Obj1 = FlatTab_GetObjTabFromCtrl($Ctrl) If $Obj1.current = $Ctrl Then Return Local $Obj2 = FlatTab_GetObjTabBtnFromCtrl($Ctrl) Local $Obj3 = FlatTab_GetObjTabBtnFromCtrl($Obj1.current) FlatTab_Draw($Ctrl, $Obj2.text, 0xFFFFFFFF, $FlatUIColor.frame+0xFF000000) FlatTab_Draw($Obj3.ctrl, $Obj3.text, 0xFFFFFFFF, $FlatUIColor.fore+0xFF000000) GUICtrlSetState($Obj2.idtab, 16) $Obj1.current = $Ctrl EndIf EndFunc Func FlatTab_GetObjTabFromCtrl($Ctrl) Local $Obj2, $Index Local $Obj = FlatTab_GetObjTabBtnFromCtrl($Ctrl) If $____aTabList[0] = 0 Then Return False For $Index = $____aTabList[0] To 1 Step -1 $Obj2 = $____aTabList[$Index] If $Obj2.ctab == $Obj.ctab Then Return $____aTabList[$Index] Next Return False EndFunc Func FlatTab_GetObjTabBtnFromCtrl($Ctrl) Local $Obj, $Index If $____aTabBtnList[0] = 0 Then Return False For $Index = $____aTabBtnList[0] To 1 Step -1 $Obj = $____aTabBtnList[$Index] If $Obj.ctrl == $Ctrl Then Return $____aTabBtnList[$Index] Next Return False EndFunc Func FlatTab_Draw($iCtrl, $Text, $Color = 0xFFFFFFFF, $BgColor = 0x00FFFFFF) Local $hWnd = _WinAPI_GetParent(GUICtrlGetHandle($iCtrl)) Local $aPos = ControlGetPos($hWnd, "", $iCtrl) Local $hFormat = _GDIPlus_StringFormatCreate() Local $hFamily = _GDIPlus_FontFamilyCreate("Segoe UI Semibold") Local $hFont = _GDIPlus_FontCreate($hFamily, 10, 0) Local $tLayout = _GDIPlus_RectFCreate(0, 0, $aPos[2], $aPos[3]) _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) Local $aBitmaps = _GDIPlus_BitmapCreateFromScan0($aPos[2], $aPos[3]) Local $aGfxCtxt = _GDIPlus_ImageGetGraphicsContext($aBitmaps) _GDIPlus_GraphicsSetSmoothingMode($aGfxCtxt, 2) _GDIPlus_GraphicsSetTextRenderingHint($aGfxCtxt, 5) _GDIPlus_GraphicsClear($aGfxCtxt, $BgColor) Local $hBrushColor = _GDIPlus_BrushCreateSolid($Color) _GDIPlus_GraphicsDrawStringEx($aGfxCtxt, $Text, $hFont, $tLayout, $hFormat, $hBrushColor) Local $aHBitmaps = _GDIPlus_BitmapCreateDIBFromBitmap($aBitmaps) _GDIPlus_BrushDispose($hBrushColor) _GDIPlus_FontDispose($hFont) _GDIPlus_BitmapDispose($aBitmaps) _GDIPlus_GraphicsDispose($aGfxCtxt) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _WinAPI_DeleteObject(GUICtrlSendMsg($iCtrl, 0x0172, 0, $aHBitmaps)) _WinAPI_DeleteObject($aHBitmaps) EndFunc FlatTab_Example.au3 expandcollapse popup#include "FlatTabEx.au3" #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Startup(); Global $hGUI = GUICreate("FlatTab Example", 450, 290); GUISetBkColor(0x3C4649, $hGUI); GUISetFont(10, 400, 0, "Segoe UI", $hGUI, 5); Global $Tab = FlatTab_Create($hGUI, 10, 10, 430, 290); ;================================================= FlatTab_AddTab($Tab, "Tab 1"); GUICtrlCreateLabel("This is Tab 1", 30, 50); GUICtrlSetColor(-1, 0xFFFFFF); GUICtrlCreateButton("Button 1", 30, 100, 75, 25); GUICtrlCreateButton("Button 2", 120, 100, 75, 25); ;================================================= FlatTab_AddTab($Tab, "Tab 2"); GUICtrlCreateLabel("This is Tab 2", 30, 50); GUICtrlSetColor(-1, 0xFFFFFF); GUICtrlCreateButton("Button 3", 210, 100, 75, 25); GUICtrlCreateButton("Button 4", 30, 150, 75, 25); ;================================================= FlatTab_AddTab($Tab, "Tab 3"); GUICtrlCreateLabel("This is Tab 3", 30, 50); GUICtrlSetColor(-1, 0xFFFFFF); GUICtrlCreateButton("Button 5", 120, 150, 75, 25); GUICtrlCreateButton("Button 6", 210, 150, 75, 25); ;================================================= GUICtrlCreateTabItem(""); GUISetState(); Do Sleep(10); Until GUIGetMsg() = -3; Hi i use GUIFlatButton in this Sample GUIFlatButton not show correct 1- shown when mouse hovered on it 2- it shown on other tabs How to fix this problem i have this problem with other GDI+ forms Check-Problem.zip
Parsix Posted January 31, 2022 Posted January 31, 2022 (edited) On 10/18/2017 at 5:46 PM, NHD said: Hi, Give you some solution for tab control from me. FlatTab.au3 expandcollapse popup#include-once #include <GDIPlus.au3> #include <Array.au3> #include "GUICtrlOnHover.au3" Global $FlatUIColor = DllStructCreate("struct;float back;float fore;float frame;endstruct;") $FlatUIColor.back = 0x3C4649 $FlatUIColor.fore = 0x23A86D ;0x3498db $FlatUIColor.frame = 0x2D2F31 Global Const $tObjTabEx = "hwnd hwnd;byte ctrl;byte ctab;" & _ "byte count;byte current;int next;" & _ "int width;int x;int y;" Global Const $tObjTabBtnEx = "byte ctrl;byte ctab;byte idtab;" & _ "wchar text[255];" Global $____aTabList[1] = [0] Global $____aTabBtnList[1] = [0] Func FlatTab_Create($hWnd, $Left, $Top, $Width, $Height) GUISwitch($hWnd) Local $oObj = DllStructCreate($tObjTabEx) _ArrayAdd($____aTabList, $oObj) $____aTabList[0] += 1 $oObj.hwnd = $hWnd $oObj.ctrl = GUICtrlCreatePic("", $Left, $Top+25, $Width, $Height-50) GUICtrlSetResizing($oObj.ctrl, 802) GUICtrlSetState($oObj.ctrl, 128) $oObj.ctab = GUICtrlCreateTab(-99, -99, 1, 1) GUICtrlSetState($oObj.ctab, 128) Local $aBmp = _GDIPlus_BitmapCreateFromScan0($Width, $Height-50) Local $hGfx = _GDIPlus_ImageGetGraphicsContext($aBmp) Local $hPen = _GDIPlus_PenCreate($FlatUIColor.frame+0xFF000000, 4) Local $hBrush = _GDIPlus_BrushCreateSolid($FlatUIColor.frame+0xFF000000) _GDIPlus_GraphicsDrawRect($hGfx, 0, 0, $Width, $Height-50, $hPen) _GDIPlus_GraphicsFillRect($hGfx, 0, 0, $Width, $Height-50, $hBrush) _GDIPlus_GraphicsClear($hGfx, $FlatUIColor.frame+0xFF000000) Local $hBmp = _GDIPlus_BitmapCreateDIBFromBitmap($aBmp) _GDIPlus_BitmapDispose($aBmp) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_PenDispose($hPen) _WinAPI_DeleteObject(GUICtrlSendMsg($oObj.ctrl, 0x0172, 0, $hBmp)) _WinAPI_DeleteObject($hBmp) $oObj.width = $Width $oObj.x = $Left $oObj.y = $Top $oObj.current = "" $oObj.count = 0 $oObj.next = $Left Return $oObj EndFunc Func FlatTab_AddTab($Ctrl, $Text) GUISwitch($Ctrl.hwnd) GUICtrlCreateTabItem("") Local $oObj = DllStructCreate($tObjTabBtnEx) _ArrayAdd($____aTabBtnList, $oObj) $____aTabBtnList[0] += 1 $oObj.ctrl = GUICtrlCreatePic("", $Ctrl.next, $Ctrl.y, 80, 25) GUICtrlSetResizing($oObj.ctrl, 802) _GUICtrl_OnHoverRegister($oObj.ctrl, 'FlatTab_EventHover', 'FlatTab_EventHover', 'FlatTab_EventClick', 'FlatTab_EventClick') $oObj.count +=1 $oObj.idtab = GUICtrlCreateTabItem($oObj.count) $oObj.text = $Text If $Ctrl.current <> "" Then Local $Prev = FlatTab_GetObjTabBtnFromCtrl($Ctrl.current) FlatTab_Draw($Prev.ctrl, $Prev.text, 0xFFFFFFFF, $FlatUIColor.fore+0xFF000000) EndIf FlatTab_Draw($oObj.ctrl, $Text, 0xFFFFFFFF, $FlatUIColor.frame+0xFF000000) $Ctrl.current = $oObj.ctrl $oObj.ctab = $Ctrl.ctab $Ctrl.next += 80 GUICtrlSetState($oObj.idtab, 16) Return $oObj.idtab EndFunc Func FlatTab_EventHover($Ctrl, $Mode) Local $Obj1 = FlatTab_GetObjTabFromCtrl($Ctrl) If $Obj1.current = $Ctrl Then Return Local $Obj2 = FlatTab_GetObjTabBtnFromCtrl($Ctrl) Switch $Mode Case 1 FlatTab_Draw($Ctrl, $Obj2.text, 0xFFFFFFFF, $FlatUIColor.fore+0xFF151515) Case 2 FlatTab_Draw($Ctrl, $Obj2.text, 0xFFFFFFFF, $FlatUIColor.fore+0xFF000000) EndSwitch EndFunc Func FlatTab_EventClick($Ctrl, $Mode) If $Mode = 2 Then Local $Obj1 = FlatTab_GetObjTabFromCtrl($Ctrl) If $Obj1.current = $Ctrl Then Return Local $Obj2 = FlatTab_GetObjTabBtnFromCtrl($Ctrl) Local $Obj3 = FlatTab_GetObjTabBtnFromCtrl($Obj1.current) FlatTab_Draw($Ctrl, $Obj2.text, 0xFFFFFFFF, $FlatUIColor.frame+0xFF000000) FlatTab_Draw($Obj3.ctrl, $Obj3.text, 0xFFFFFFFF, $FlatUIColor.fore+0xFF000000) GUICtrlSetState($Obj2.idtab, 16) $Obj1.current = $Ctrl EndIf EndFunc Func FlatTab_GetObjTabFromCtrl($Ctrl) Local $Obj2, $Index Local $Obj = FlatTab_GetObjTabBtnFromCtrl($Ctrl) If $____aTabList[0] = 0 Then Return False For $Index = $____aTabList[0] To 1 Step -1 $Obj2 = $____aTabList[$Index] If $Obj2.ctab == $Obj.ctab Then Return $____aTabList[$Index] Next Return False EndFunc Func FlatTab_GetObjTabBtnFromCtrl($Ctrl) Local $Obj, $Index If $____aTabBtnList[0] = 0 Then Return False For $Index = $____aTabBtnList[0] To 1 Step -1 $Obj = $____aTabBtnList[$Index] If $Obj.ctrl == $Ctrl Then Return $____aTabBtnList[$Index] Next Return False EndFunc Func FlatTab_Draw($iCtrl, $Text, $Color = 0xFFFFFFFF, $BgColor = 0x00FFFFFF) Local $hWnd = _WinAPI_GetParent(GUICtrlGetHandle($iCtrl)) Local $aPos = ControlGetPos($hWnd, "", $iCtrl) Local $hFormat = _GDIPlus_StringFormatCreate() Local $hFamily = _GDIPlus_FontFamilyCreate("Segoe UI Semibold") Local $hFont = _GDIPlus_FontCreate($hFamily, 10, 0) Local $tLayout = _GDIPlus_RectFCreate(0, 0, $aPos[2], $aPos[3]) _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) Local $aBitmaps = _GDIPlus_BitmapCreateFromScan0($aPos[2], $aPos[3]) Local $aGfxCtxt = _GDIPlus_ImageGetGraphicsContext($aBitmaps) _GDIPlus_GraphicsSetSmoothingMode($aGfxCtxt, 2) _GDIPlus_GraphicsSetTextRenderingHint($aGfxCtxt, 5) _GDIPlus_GraphicsClear($aGfxCtxt, $BgColor) Local $hBrushColor = _GDIPlus_BrushCreateSolid($Color) _GDIPlus_GraphicsDrawStringEx($aGfxCtxt, $Text, $hFont, $tLayout, $hFormat, $hBrushColor) Local $aHBitmaps = _GDIPlus_BitmapCreateDIBFromBitmap($aBitmaps) _GDIPlus_BrushDispose($hBrushColor) _GDIPlus_FontDispose($hFont) _GDIPlus_BitmapDispose($aBitmaps) _GDIPlus_GraphicsDispose($aGfxCtxt) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _WinAPI_DeleteObject(GUICtrlSendMsg($iCtrl, 0x0172, 0, $aHBitmaps)) _WinAPI_DeleteObject($aHBitmaps) EndFunc FlatTab_Example.au3 expandcollapse popup#include "FlatTabEx.au3" #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Startup(); Global $hGUI = GUICreate("FlatTab Example", 450, 290); GUISetBkColor(0x3C4649, $hGUI); GUISetFont(10, 400, 0, "Segoe UI", $hGUI, 5); Global $Tab = FlatTab_Create($hGUI, 10, 10, 430, 290); ;================================================= FlatTab_AddTab($Tab, "Tab 1"); GUICtrlCreateLabel("This is Tab 1", 30, 50); GUICtrlSetColor(-1, 0xFFFFFF); GUICtrlCreateButton("Button 1", 30, 100, 75, 25); GUICtrlCreateButton("Button 2", 120, 100, 75, 25); ;================================================= FlatTab_AddTab($Tab, "Tab 2"); GUICtrlCreateLabel("This is Tab 2", 30, 50); GUICtrlSetColor(-1, 0xFFFFFF); GUICtrlCreateButton("Button 3", 210, 100, 75, 25); GUICtrlCreateButton("Button 4", 30, 150, 75, 25); ;================================================= FlatTab_AddTab($Tab, "Tab 3"); GUICtrlCreateLabel("This is Tab 3", 30, 50); GUICtrlSetColor(-1, 0xFFFFFF); GUICtrlCreateButton("Button 5", 120, 150, 75, 25); GUICtrlCreateButton("Button 6", 210, 150, 75, 25); ;================================================= GUICtrlCreateTabItem(""); GUISetState(); Do Sleep(10); Until GUIGetMsg() = -3; how to set as default tab? Can anyone help? Edited January 31, 2022 by Parsix
TesterMachine Posted May 19, 2022 Posted May 19, 2022 I have a problem... when executing the example it sends the following error: Local $aResult = DllCall($__g_hGDIPDll, "int", "GdipGetDpiX", "handle", $hGfx, "float*", 0) Local $aResult = DllCall(^ ERROR
Moderators Melba23 Posted May 19, 2022 Moderators Posted May 19, 2022 TesrerMachine, Are you running a very old version of AutoIt? Because a long time ago $__g_hGDIPDll replaced $ghGDIPDll in the GDI libraries and it looks as if you might still be using the old versions. M23 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
TesterMachine Posted May 19, 2022 Posted May 19, 2022 2 minutes ago, Melba23 said: TesrerMachine, Are you running a very old version of AutoIt? Because a long time ago $__g_hGDIPDll replaced $ghGDIPDll in the GDI libraries and it looks as if you might still be using the old versions. M23 sorry I'm a bit new to AutoIT and well... checking AutoUpdateIt marks version 3.3.10.1 I will update to another more recent version, thanks Melba23
kaz Posted August 9, 2022 Posted August 9, 2022 (edited) I try to add a group under control, but event are no longer working. Controls events outside group are working perfectly but not inside. Is it possible when gdi control over gdi graphic (only) to make events working ? Edited August 9, 2022 by kaz
pat4005 Posted September 3, 2022 Posted September 3, 2022 On 8/10/2022 at 12:13 AM, kaz said: I try to add a group under control, but event are no longer working. Controls events outside group are working perfectly but not inside. Is it possible when gdi control over gdi graphic (only) to make events working ? How do you draw such group? I mean why is it looks so nice, with background color, rounded corners, outline, etc..?
kaz Posted September 6, 2022 Posted September 6, 2022 On 9/3/2022 at 2:21 PM, pat4005 said: How do you draw such group? I mean why is it looks so nice, with background color, rounded corners, outline, etc..? Hello, and Sory for the delay. I changed a litle bit the original metro_gui udf, with starting a new theme and this function expandcollapse popupFunc _CreateGroup($Text, $Left, $Top, $Width, $Height) Local $Group_Array[4] $Group_Array[1] = False ; Set hover OFF $Group_Array[2] = "0" ; Type ;~ $Group_Array[15] = GetCurrentGUI() $Group_Color = "0xFF" & Hex($Group_Color, 6) $rayon = 20 $diam = $rayon * 2 Local $Brush_group = _GDIPlus_BrushCreateSolid($Group_Color) Local $hDrawPen = _GDIPlus_PenCreate(StringReplace($hDrawPen_Color, "0x", "0xFF"), 1 ) ; taille pen contour mouse out local $Group_Graphic = _iGraphicCreate($Width, $Height, StringReplace($GUIThemeColor, "0x", "0xFF"), 5, 5 ) ;Default hover state Local $hPath1 = _GDIPlus_PathCreate() _GDIPlus_PathAddArc($hPath1, $Width - $diam - 1, 0, $diam, $diam, 270, 90) _GDIPlus_PathAddArc($hPath1, $Width - $diam - 1, $Height - $diam - 1, $diam, $diam, 0, 90) _GDIPlus_PathAddArc($hPath1, 0, $Height - $diam - 1, $diam , $diam , 90, 90) _GDIPlus_PathAddArc($hPath1, 0, 0 , $diam, $diam, 180, 90) _GDIPlus_PathCloseFigure($hPath1) _GDIPlus_GraphicsFillPath($Group_Graphic[0], $hPath1, $Brush_group) _GDIPlus_GraphicsDrawPath($Group_Graphic[0], $hPath1, $hDrawPen) _GDIPlus_BrushDispose($Brush_group) _GDIPlus_PenDispose($hDrawPen) _GDIPlus_PathDispose($hPath1) ;Set graphic and return Bitmap handle $Group_Array[0] = GUICtrlCreatePic("", $Left, $Top, $Width, $Height) $Group_Array[3] = _iGraphicCreateBitmapHandle($Group_Array[0], $Group_Graphic) ;Set GUI Resizing GUICtrlSetResizing($Group_Array[0], 768) Return $Group_Array[0] EndFunc Case "LightGray" $GUIThemeColor = "0xEAEAEA" $FontThemeColor = "0x000000" $ButtonTextColor = "0x000000" $ActiveColor = "0xFFFFFF" $InactiveColor = "0xE0E0E0" $hDrawPen_Color = "0xBDBDBD" $GUIBorderColor = "0xD8D8D8" $ButtonBKColor = "0xE0E0E0" $Group_Color = "0xF6F6F6" $CB_Radio_Color = "0xFFFFFF" $CB_Radio_Hover_Color = "0xE8E8E8" $CB_Radio_CheckMark_Color = "0xffff" I tried to obtain something near macOS style... Parsix 1 1
boyhong Posted September 13, 2022 Posted September 13, 2022 First of all, thank you for your help.... I removed the maximize button, but the window will be maximized in full screen at once. Can you do this without full screen: Quote $Control_Buttons = _Metro_AddControlButtons(True, False, True, False, False)
gmmg Posted April 17, 2023 Posted April 17, 2023 Hello together, how can i change the Text from the _Metro_CreateButton at runtime? Example: $button = _Metro_CreateButton("", bla, bla, bla ... etc) If $var < 100 then $button txt = "<100" If $var > 100 then $button txt = ">100" greetings, marcel
AutoBert Posted April 17, 2023 Posted April 17, 2023 Delete the button, as i see in the example GuiCtrlDelete (used in Func _ThemesDemo) should do the job. After create a new button with the wanted text.
Skeletor Posted April 17, 2023 Posted April 17, 2023 (edited) I just wanted to show a display of one of my programs. I'm looking into changing all my programs to look similar. Also Im planning on making this theme setup automated, like after you create a UI in Koda, applying the MetroUI theme... lets see if I have time for this. So this program allows me to change the drive letter of my external drives quickly. Edited April 17, 2023 by Skeletor Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI
gmmg Posted April 18, 2023 Posted April 18, 2023 @AutoBert Thanks for your reply. It works with GUICtrlDelete($File_Button)
gmmg Posted April 21, 2023 Posted April 21, 2023 Hello, how can i set the text aligment in a _Metro_MsgBox to Center text?
Skeletor Posted April 25, 2023 Posted April 25, 2023 @gmmg You could add $SS_CENTER for the following to the MetroGUI_UDF.au3 GUICtrlCreateLabel($Text, 15 * $msgbDPI, 50 * $msgbDPI, $LabelSize[2], $LabelSize[3], $SS_CENTER, 0x00100000) However, the message box will only center once it reaches a certain amount of characters per line. Others may have a better solution. Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI
gmmg Posted April 26, 2023 Posted April 26, 2023 (edited) @Skeletor: thanks, i try it I have changed the code in my MetroGUI_UDF.au3 to the following. ;GUICtrlCreateLabel($Text, 20, ($mHeight / 2) -30, $mWidth - 40, 40, 0x01, 0x00100000) ;Center Text If StringLen($Text) <= 52 Then GUICtrlCreateLabel($Text, 20, ($mHeight / 2) -20, $mWidth - 40, 40, 0x01, 0x00100000) ;Center Text If StringLen($Text) > 52 Then GUICtrlCreateLabel($Text, 20, ($mHeight / 2) -30, $mWidth - 40, 40, 0x01, 0x00100000) ;Center Text KR, gmmg Edited April 26, 2023 by gmmg
Skeletor Posted May 17, 2023 Posted May 17, 2023 WinAPI_GetCapture Already defined Came across this issue within the SSCtrlHover.au3 file, I commented it out and it worked fine. Not sure if anyone else has this issue. This also affected the example script as well. ;~ Func _WinAPI_GetCapture() ;~ Return DllCall("user32.dll", "HWND", "GetCapture")[0] ;~ EndFunc ;==>_WinAPI_GetCapture Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI
roccos34 Posted September 6, 2023 Posted September 6, 2023 (edited) I encountered problems with the latest releases of Autoit 3.3.16.0 and 3.3.16.1 (in the latter version I found a function with a duplicate name on the libraries). I wonder whether a compatible version will be released soon, perhaps with Window 11 style. Thanks Edited September 6, 2023 by roccos34
StatQuo Posted March 7, 2024 Posted March 7, 2024 Any way to hide _Metro_CreateProgress bar ? GUICtrlSetState($ProgressID, $GUI_HIDE) dosen't work :/
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