Jump to content
Sign in to follow this  
playlet

---

Recommended Posts

playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
MvGulik

Mmm. Don't see any reason for using $GUI_ONTOP on radio-controls, and think is a questionable use. But ok.

Bug(?): The first radio-control seems to not be effected by a applied $GUI_ONTOP state.

- $GUI_ONTOP will lift radio from current location/group to Topmost location -> other (last it seems) group.

Tip: use 4 radio's per group. Makes it easier to see the action relation's.

---

Applied: Might not get applied of course.

Edited by iEvKI3gv9Wrkd41u

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
taietel

Maybe this could be a solution:

#include <GUIConstantsEx.au3>

GUICreate("Form", 300, 400)

$hGroup = GUICtrlCreateGroup("Group1", 10, 10, 280, 380)
GUIStartGroup()
GUICtrlCreateRadio("Radio1", 30, 70, 113, 17)
GUICtrlSetState(-1,$GUI_CHECKED)
GUICtrlCreateRadio("Radio2", 30, 90, 113, 17)
GUICtrlCreateRadio("Radio3", 30, 110, 113, 17)

GUIStartGroup()
GUICtrlCreateRadio("RadioA", 30, 150, 113, 17)
GUICtrlSetState(-1,$GUI_CHECKED)
GUICtrlCreateRadio("RadioB", 30, 170, 113, 17)
GUICtrlCreateRadio("RadioC", 30, 190, 113, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)

While 1
 Sleep(10)
 Switch GUIGetMsg()
  Case -3
   Exit
 EndSwitch
WEnd

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
rover

I replaced radios with checkboxes and everything seems to work fine.

Thanks for all your help!!

There is an issue with using GUIStartGroup() on radios set to top of the Z order,

but i'm not so sure it's a bug.

I'm working on something that uses WS_EX_COMPOSITED to prevent resize flicker

and the controls are on top of an image.

Because of the bottom up Z order double buffering of that style, the controls need to be on top

for the same reason as is suggested in the remarks for GUICtrlCreatePic regarding the Tab, TreeView and Listview.

GuiCtrlSetState(-1, $GUI_ONTOP) is the same as this:

_WinAPI_SetWindowPos(GUICtrlGetHandle(-1), $HWND_TOP, 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))

The radios won't work properly with this line either.

This will put the radios above the pic and they will function correctly with GUIStartGroup()

_WinAPI_SetWindowPos(GUICtrlGetHandle($cPic), GUICtrlGetHandle($cRadio), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))

Edit: this is tested code, not speculation

Edited by rover

I see fascists...

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
rover

That works great!

What about here? -

I need to use $GUI_ONTOP because of the label in line 84

you need two includes

#Include <Constants.au3>

#Include <GUIConstantsEx.au3>

replace from line 87 on down:

$TabC = GUICtrlCreateTab(160, 60, 335, 325, -1, 0x00100000)
Local $hTabC = GUICtrlGetHandle($TabC)
GUICtrlSetState(-1, 128)
GUICtrlCreateTabItem("T1")

;$1 = GUICtrlCreateButton("Button 1", 200, 100, 100, 25)
;GUICtrlSetState(-1, 2048)

GUIStartGroup()
$Text1 = GUICtrlCreateRadio("", 190, 105, 20, 20)
GUICtrlSetState(-1, 1)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))

$Text2 = GUICtrlCreateRadio("", 280, 105, 20, 20)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))

$Text3 = GUICtrlCreateRadio("", 370, 105, 20, 20)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))


GUICtrlCreateLabel("Option A", 210, 108, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Option B", 300, 108, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Option C", 390, 108, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)


GUIStartGroup()
$Col1 = GUICtrlCreateRadio("", 190, 315, 20, 20)
GUICtrlSetState(-1, 1)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))
$Col2 = GUICtrlCreateRadio("", 280, 315, 20, 20)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))
$Col3 = GUICtrlCreateRadio("", 370, 315, 20, 20)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))
GUICtrlCreateLabel("Color 1", 210, 318, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Color 2", 300, 318, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Color 3", 390, 318, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)

I see fascists...

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
rover

This is the modified version of your script I excerpted that section from

#AutoIt3Wrapper_Res_Fileversion=1.1.0.0
#Include <Constants.au3>
#include <WinAPI.au3>
#include <GDIPlus.au3>
#Include <GUIConstantsEx.au3>

Opt("TrayAutoPause", 0)
OnAutoItExitRegister("DisposeAll")

_GDIPlus_Startup()

Global $GT = "GUI Title", $ImgA[3], $PosA[7][2], $Tab[5], $TabA[5][3], $But[3], $ButA[3][3], $TabNum = 4

; loading images
$ImgA[0] = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\normal.png")
$ImgA[1] = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\over.png")
$ImgA[2] = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\pressed.png")
Local $Img1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\skin.png")
Local $Img2 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\title_button.png")

; main GUI with title
Global $USWin = GUICreate($GT, 528, 440, -1, -1, 0x80000000, BitOR(0x00080000, 0x00000008));, 0x80)
Local $hGraphic1a = _GDIPlus_GraphicsCreateFromHWND(_WinAPI_GetDesktopWindow())
Local $hBitmapa = _GDIPlus_BitmapCreateFromGraphics(528, 440, $hGraphic1a)
Local $hGraphic2a = _GDIPlus_ImageGetGraphicsContext($hBitmapa)
_GDIPlus_GraphicsDrawImageRect($hGraphic2a, $Img1, 88, 0, 440, 440)
_GDIPlus_GraphicsDrawImageRect($hGraphic2a, $Img2, 138, 5, 198, 45)
_GDIPlus_GraphicsDrawString_($hGraphic2a, $GT, 148, 11, "Comic Sans MS", 12)
_GDIPlus_GraphicsDispose($hGraphic2a)
_GDIPlus_GraphicsDispose($hGraphic1a)
SetBitmap($USWin, $hBitmapa, 255)
_GDIPlus_GraphicsDispose($hBitmapa)
_GDIPlus_ImageDispose($Img1)
_GDIPlus_ImageDispose($Img2)

; position labels for all buttons
$PosA[1][0] = GUICtrlCreateLabel("", 0, 99, 157, 30); tab buttons
$PosA[2][0] = GUICtrlCreateLabel("", 0, 132, 157, 30)
$PosA[3][0] = GUICtrlCreateLabel("", 0, 165, 157, 30)
$PosA[4][0] = GUICtrlCreateLabel("", 0, 198, 157, 30)
$PosA[$TabNum + 1][0] = GUICtrlCreateLabel("", 137, 402, 160, 35); save button
$PosA[$TabNum + 2][0] = GUICtrlCreateLabel("", 317, 402, 160, 35); close button
For $i = 1 To $TabNum + 2
    $PosA[$i][1] = 0
Next

; tab button 1
$Tab[1] = GUICreate($GT, 165, 227, 0, 100, 0x80000000, BitOR(0x00080000, 0x00000008, 0x00000040, 0x08000000), $USWin)
DrawImg($TabA, 1, $ImgA, "Tab 1", 10, 4, "Comic Sans MS", 11)
SetBitmap($Tab[1], $TabA[1][2], 255); set the first tab button as pressed

; tab button 2
$Tab[2] = GUICreate($GT, 165, 227, 0, 133, 0x80000000, BitOR(0x00080000, 0x00000008, 0x00000040, 0x08000000), $USWin)
DrawImg($TabA, 2, $ImgA, "Tab 2", 10, 4, "Comic Sans MS", 11)
SetBitmap($Tab[2], $TabA[2][0], 255)

; tab button 3
$Tab[3] = GUICreate($GT, 165, 227, 0, 166, 0x80000000, BitOR(0x00080000, 0x00000008, 0x00000040, 0x08000000), $USWin)
DrawImg($TabA, 3, $ImgA, "Tab 3", 10, 4, "Comic Sans MS", 11)
SetBitmap($Tab[3], $TabA[3][0], 255)

; tab button 4
$Tab[4] = GUICreate($GT, 165, 227, 0, 199, 0x80000000, BitOR(0x00080000, 0x00000008, 0x00000040, 0x08000000), $USWin)
DrawImg($TabA, 4, $ImgA, "Tab 4", 10, 4, "Comic Sans MS", 11)
SetBitmap($Tab[4], $TabA[4][0], 255)

; save button
$But[1] = GUICreate($GT, 345, 38, 138, 405, 0x80000000, BitOR(0x00080000, 0x00000008, 0x00000040, 0x08000000), $USWin)
DrawImg($ButA, 1, $ImgA, "Save", 10, 4, "Comic Sans MS", 11)
SetBitmap($But[1], $ButA[1][0], 255)

; close button
$But[2] = GUICreate($GT, 345, 38, 318, 405, 0x80000000, BitOR(0x00080000, 0x00000008, 0x00000040, 0x08000000), $USWin)
DrawImg($ButA, 2, $ImgA, "Close", 10, 4, "Comic Sans MS", 11)
SetBitmap($But[2], $ButA[2][0], 255)

; release loaded images
_GDIPlus_ImageDispose($ImgA[0])
_GDIPlus_ImageDispose($ImgA[1])
_GDIPlus_ImageDispose($ImgA[2])

; tab controls GUI
$AGUI_Text = GUICreate($GT, 528, 440, 0, 0, 0x80000000, BitOR(0x00080000, 0x00000040), $USWin)
GUISetBkColor(0x003842, $AGUI_Text)
GUICtrlCreateLabel("", 160, 60, 335, 325); label used to hide tab control
GUICtrlSetBkColor(-1, -2)
GUICtrlSetState(-1, $GUI_DISABLE)
$TabC = GUICtrlCreateTab(160, 60, 335, 325, -1, 0x00100000)
Local $hTabC = GUICtrlGetHandle($TabC)
GUICtrlSetState(-1, 128)
GUICtrlCreateTabItem("T1")

;$1 = GUICtrlCreateButton("Button 1", 200, 100, 100, 25)
;GUICtrlSetState(-1, 2048)

GUIStartGroup()
$Text1 = GUICtrlCreateRadio("", 190, 105, 20, 20)
GUICtrlSetState(-1, 1)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))

$Text2 = GUICtrlCreateRadio("", 280, 105, 20, 20)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))

$Text3 = GUICtrlCreateRadio("", 370, 105, 20, 20)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))


GUICtrlCreateLabel("Option A", 210, 108, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Option B", 300, 108, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Option C", 390, 108, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)


GUIStartGroup()
$Col1 = GUICtrlCreateRadio("", 190, 315, 20, 20)
GUICtrlSetState(-1, 1)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))
$Col2 = GUICtrlCreateRadio("", 280, 315, 20, 20)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))
$Col3 = GUICtrlCreateRadio("", 370, 315, 20, 20)
_WinAPI_SetWindowPos($hTabC, GUICtrlGetHandle(-1), 0, 0, 0, 0, BitOR($SWP_NOSIZE, $SWP_NOMOVE))
GUICtrlCreateLabel("Color 1", 210, 318, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Color 2", 300, 318, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Color 3", 390, 318, 80, 20)
GUICtrlSetColor(-1, 0xFFFFFF)

GUICtrlCreateTabItem("T2")
$2 = GUICtrlCreateButton("Button 2", 200, 150, 100, 25)
GUICtrlSetState(-1, 2048)
GUICtrlCreateTabItem("T3")
$3 = GUICtrlCreateButton("Button 3", 200, 200, 100, 25)
GUICtrlSetState(-1, 2048)
GUICtrlCreateTabItem("T4")
$4 = GUICtrlCreateButton("Button 4", 200, 250, 100, 25)
GUICtrlSetState(-1, 2048)
GUICtrlCreateTabItem("")
_WinAPI_SetLayeredWindowAttributes($AGUI_Text, 0x003842, 255)

; show all GUIs - kind of like an animation effect
GUISetState(@SW_SHOW, $USWin)
For $i = 1 To $TabNum
    GUISetState(@SW_SHOW, $Tab[$i])
Next
GUISetState(@SW_SHOW, $But[1])
GUISetState(@SW_SHOW, $But[2])
GUISetState(@SW_SHOW, $AGUI_Text)

; set the first tab button as pressed
$curr = 1
;$prev = 0

While 1
    For $i = 1 To $TabNum + 2; 4 tabs + 2 buttons
        Switch $i
            Case 1 To $TabNum; tab buttons - 2-state
                If $curr = $i Then ContinueLoop; don't check the state of the current tab
                $pos = GUIGetCursorInfo($USWin)
                If $pos[4] = $PosA[$i][0] Then
                    If $pos[3] = 1 Then ExitLoop
                    If $pos[2] = 1 Then ExitLoop
                    While $pos[4] = $PosA[$i][0]
                        If GUIGetMsg() = -3 Then Exit
                        $pos = GUIGetCursorInfo($USWin)
                        Switch $pos[2]
                            Case 0; not pressed
                                If $PosA[$i][1] <> 1 Then
                                    SetBitmap($Tab[$i], $TabA[$i][1], 255)
                                    $PosA[$i][1] = 1
                                EndIf
                            Case 1; pressed - change tab
                                If $PosA[$i][1] <> 2 Then
                                    SetBitmap($Tab[$curr], $TabA[$curr][0], 255)
                                    SetBitmap($Tab[$i], $TabA[$i][2], 255)
                                    GUICtrlSendMsg($TabC, 0x1300 + 48, $i - 1, 0)
                                    $PosA[$i][1] = 2
                                    ;$prev = $curr
                                    $curr = $i
                                    ExitLoop
                                EndIf
                        EndSwitch
                        Sleep(10)
                    WEnd
                    If $curr <> $i Then SetBitmap($Tab[$i], $TabA[$i][0], 255)
                    $PosA[$i][1] = 0
                EndIf
            Case Else; save and close buttons - 3-state
                $pos = GUIGetCursorInfo($USWin)
                If $pos[4] = $PosA[$i][0] Then
                    If $pos[3] = 1 Then ExitLoop
                    If $pos[2] = 1 Then ExitLoop
                    While $pos[4] = $PosA[$i][0]
                        $pos = GUIGetCursorInfo($USWin)
                        Switch $pos[2]
                            Case 0; not pressed
                                If $PosA[$i][1] <> 1 Then
                                    SetBitmap($But[$i - $TabNum], $ButA[$i - $TabNum][1], 255)
                                    $PosA[$i][1] = 1
                                EndIf
                            Case 1
                                While $pos[2] = 1; holding pressed
                                    $pos = GUIGetCursorInfo($USWin)
                                    Switch $pos[4]
                                        Case $PosA[$i][0]; on button, pressed
                                            If $PosA[$i][1] <> 2 Then
                                                SetBitmap($But[$i - $TabNum], $ButA[$i - $TabNum][2], 255)
                                                $PosA[$i][1] = 2
                                            EndIf
                                        Case Else; not on button, pressed
                                            If $PosA[$i][1] <> 3 Then
                                                SetBitmap($But[$i - $TabNum], $ButA[$i - $TabNum][1], 255)
                                                $PosA[$i][1] = 3
                                            EndIf
                                    EndSwitch
                                    Sleep(10)
                                WEnd
                                If $pos[4] = $PosA[$i][0] Then
                                    Switch $i - $TabNum
                                        Case 1; save button pressed
                                            MsgBox(0 + 262144, $GT, "Saved")
                                        Case 2; close button pressed
                                            Exit
                                    EndSwitch
                                EndIf
                        EndSwitch
                        Sleep(10)
                    WEnd
                    SetBitmap($But[$i - $TabNum], $ButA[$i - $TabNum][0], 255)
                    $PosA[$i][1] = 0
                EndIf
        EndSwitch
    Next
    Switch GUIGetMsg(); this is for tab controls
        Case -3
            Exit
        Case $2, $3, $4
            MsgBox(0 + 262144, $GT, "You have pressed a Button")
    EndSwitch
    Sleep(10)
WEnd

Func DisposeAll()
    For $i = 1 To $TabNum
        _GDIPlus_BitmapDispose($TabA[$i][0])
        _GDIPlus_BitmapDispose($TabA[$i][1])
        _GDIPlus_BitmapDispose($TabA[$i][2])
    Next
    For $i = 1 To 2
        _GDIPlus_BitmapDispose($ButA[$i][0])
        _GDIPlus_BitmapDispose($ButA[$i][1])
        _GDIPlus_BitmapDispose($ButA[$i][2])
    Next
EndFunc   ;==>DisposeAll

Func DrawImg(ByRef $RetA, $indx, $Imgs, $text, $xx, $yy, $sFont = "Comic Sans MS", $nSize = 10, $ncol = "000000", $iFormat = 0)
    For $i = 0 To 2
        Local $hGraphic1 = _GDIPlus_GraphicsCreateFromHWND(_WinAPI_GetDesktopWindow())
        Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics(165, 38, $hGraphic1)
        Local $hGraphic2 = _GDIPlus_ImageGetGraphicsContext($hBitmap)
        _GDIPlus_GraphicsDrawImageRect($hGraphic2, $Imgs[$i], 0, 0, 165, 38)
        _GDIPlus_GraphicsDrawString_($hGraphic2, $text, $xx, $yy, $sFont, $nSize, $ncol, $iFormat)
        _GDIPlus_GraphicsDispose($hGraphic2)
        _GDIPlus_GraphicsDispose($hGraphic1)
        $RetA[$indx][$i] = $hBitmap
    Next
EndFunc   ;==>DrawImg

Func _GDIPlus_GraphicsDrawString_($hGraphics, $sString, $nX, $nY, $sFont = "Comic Sans MS", $nSize = 10, $ncol = "000000", $iFormat = 0)
    If StringLeft($ncol, 2) = "0x" Then $ncol = StringTrimLeft($ncol, 2)
    Local $hBrush = _GDIPlus_BrushCreateSolid("0xFF" & $ncol)
    Local $hFormat = _GDIPlus_StringFormatCreate($iFormat)
    Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $nSize)
    Local $tLayout = _GDIPlus_RectFCreate($nX, $nY, 0, 0)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $sString, $hFont, $tLayout, $hFormat)
    Local $aResult = _GDIPlus_GraphicsDrawStringEx($hGraphics, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
    Local $iError = @error
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hBrush)
    Return SetError($iError, 0, $aResult)
EndFunc   ;==>_GDIPlus_GraphicsDrawString_

Func SetBitmap($hGUI, $hImage, $iOpacity)
    Local $hScrDC = _WinAPI_GetDC(0)
    Local $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
    Local $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    Local $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
    $tSize = DllStructCreate("long X;long Y")
    $pSize = DllStructGetPtr($tSize)
    DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage))
    DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
    $tSource = DllStructCreate("long X;long Y")
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate("byte Op;byte Flags;byte Alpha;byte Format")
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", $iOpacity)
    DllStructSetData($tBlend, "Format", 1)
    _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, 0x02)
    _WinAPI_ReleaseDC(0, $hScrDC)
    _WinAPI_SelectObject($hMemDC, $hOld)
    _WinAPI_DeleteObject($hBitmap)
    _WinAPI_DeleteDC($hMemDC)
EndFunc   ;==>SetBitmap

I see fascists...

Share this post


Link to post
Share on other sites
rover

My mistake, I left out the disable label line from the above section

GUICtrlCreateLabel("", 160, 60, 335, 325); label used to hide tab control

GUICtrlSetBkColor(-1, -2)

GUICtrlSetState(-1, $GUI_DISABLE)


I see fascists...

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
rover

It finally works! Thanks a lot!!!!!!

GUICtrlSetState(-1, $GUI_DISABLE) was missing below line 86.

Thanks again!!

no problem

your message loop could use some work

perhaps set those images into pic controls so you don't have to do all that polling

and that sleep in the message loop should be eliminated

you could also add vars to those option labels so they could set the checked state of the radios

so users can click on the label as well as the radio

something like this

$msg = GUIGetMsg(); this is for tab controls
    Switch $msg
        Case $Text1Lb, $Text2Lb, $Text3Lb
            Switch $msg
                Case $Text1Lb
                    GUICtrlSetState($Text1, $GUI_CHECKED)
                Case $Text2Lb
                    GUICtrlSetState($Text2, $GUI_CHECKED)
                Case $Text3Lb
                    GUICtrlSetState($Text3, $GUI_CHECKED)
            EndSwitch
        Case -3
            Exit
        Case $2, $3, $4
            MsgBox(0 + 262144, $GT, "You have pressed a Button")
    EndSwitch

but you need to fix that message loop first, as the above code is somewhat unresponsive


I see fascists...

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
MvGulik

There is an issue with using GUIStartGroup() on radios set to top of the Z order,

but i'm not so sure it's a bug.

You have some more data/info on this for me.

Never mind. Bug seems no bug after playing around with it some more.

GUIStartGroup() is/seems somewhat of a pre-setting for the next created Radio-control. As such the observed behavior (so far) makes actually sense.

Edited by iEvKI3gv9Wrkd41u

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites
rover

You have some more data/info on this for me.

Never mind. Bug seems no bug after playing around with it some more.

GUIStartGroup() is/seems somewhat of a pre-setting for the next created Radio-control. As such the observed behavior (so far) makes actually sense.

@Playlet

You only need the GUICtrlSetState(-1, $GUI_DISABLE) line added to the tab masking label.

Remove all the SetWindowPos lines.

Only the last one was actually needed, to place the tab control beneath the lowest Z order radio.

Disabling the label eliminated the need for SetWindowPos.

That code is completely unnecessary if the control code creation order is correct.

I only needed to move the pic creation code after all the controls

because of the bottom up double buffering.

@iEvKI3gv9Wrkd41u

Yes, your absolutely right, definitely not a bug.

I did not consider that Z order was the way that radios are grouped.

I never thought of it before.

AutoIt is my starting and only language, so I never considered what

method was used behind the scenes to keep track of the group members,

and if controls were deleted or added. (so much done for us in AutoIt behind the scenes)

It's by Z order alone, and deleting or adding controls screws up the radio button effect.

$GUI_ONTOP changes the Z order of the control,

it has no effect on the radios group operation if GUICtrlCreateGroup or GUIStartGroup

are not used and there is only one group of radios,

but if used on each radio, it reverses the Z order of the group.


I see fascists...

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.