Jump to content
dreamzboy

Transparent Groups, Radio, and Missing Tabs

Recommended Posts

Hello,

I would like to know how to go about making the following item clear and transparent.   They're currently being highlight by a blue/black bar over the texts.  I've read through pages and pages of "transparent group, radios, and checkboxes" but none looks like a simple implemenation nor does it apply to my case.

  • Groups Text
  • Radio Text

Also, I'm unable to see my tabs perhaps it's being hidden by the background picture? (see figure 2 for what it's supposed to look like).  Using the code from AdmiralClaws, it made the radio graphic or style a little plain and I would like to restore it.  I don't need the tab section transparent, just the dark grey area around it.
 

Example:

$chk = GUICtrlCreateCheckbox("This is checkbox - Lorem ipsum dolor sit amet.", 20, 20)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
$lbl = GUICtrlCreateLabel("This is label - Lorem ipsum dolor sit amet", 20, 100)
$rdo = GUICtrlCreateRadio("This is radio - Lorem ipsum dolor sit amet", 20, 180)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)

Test Program

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Example()

Func Example()

    ; Create a GUI with various controls.
    Local $hGUI = GUICreate("Example", 400, 300)
    ; GUICtrlCreatePic (".\background.bmp", 0, 0, 400, 300)
    GUICtrlCreateTab (20, 20, 360, 260)
    GUICtrlCreateTabItem ("Option 1")
    GUICtrlCreateGroup ("Radio", 40, 60, 320, 200)
    $radio1 = GUICtrlCreateRadio ("Radio 1", 60, 80)
    ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($radio1), "wstr", 0, "wstr", 0)
    $radio2 = GUICtrlCreateRadio ("Radio 2", 60, 110)
    ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($radio2), "wstr", 0, "wstr", 0)

    GUICtrlCreateTab (30, 30, 360, 260)
    GUICtrlCreateTabItem ("Option 2")
    GUICtrlCreateGroup ("Radio", 40, 60, 320, 200)
    $radio3 = GUICtrlCreateRadio ("Radio 3", 60, 80)
    ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
    $radio4 = GUICtrlCreateRadio ("Radio 4", 60, 110)
    ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)

    ; Display the GUI.
    GUISetState(@SW_SHOW, $hGUI)

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop

        EndSwitch
    WEnd

    ; Delete the previous GUIs and all controls.
    GUIDelete($hGUI)
EndFunc   ;==>Example

test1.jpg

(Figure 1)

test2.jpg

(Figure 2)

Edited by dreamzboy

Share this post


Link to post
Share on other sites

dreamzboy,

Create the background picture after the tabs and set the $WS_CLIPSIBLINGS style - then you see the tab control. In this example I have also corrected the tab creation code and added a little extra code to force the tabs to fill the entire control (otherwise you get a nasty grey area at top right where there are no tabs): :)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <TabConstants.au3>

Example()

Func Example()

    ; Create a GUI with various controls.
    Local $hGUI = GUICreate("Example", 400, 300)

    $cTab = GUICtrlCreateTab (20, 20, 360, 260, $TCS_FIXEDWIDTH) ; Add style for user-defined tab width
    GUICtrlCreateTabItem ("Option 1")
    GUICtrlCreateGroup ("Radio A", 40, 60, 320, 200)
    $radio1 = GUICtrlCreateRadio ("Radio 1", 60, 80)
    ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($radio1), "wstr", 0, "wstr", 0)
    $radio2 = GUICtrlCreateRadio ("Radio 2", 60, 110)
    ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($radio2), "wstr", 0, "wstr", 0)

    GUICtrlCreateTabItem ("Option 2")
    GUICtrlCreateGroup ("Radio B", 40, 60, 320, 200)
    $radio3 = GUICtrlCreateRadio ("Radio 3", 60, 80)
    ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
    $radio4 = GUICtrlCreateRadio ("Radio 4", 60, 110)
    ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)

    GUICtrlCreateTabItem ("")

    ; Force tabs to cover whole width of control
    $aPos = ControlGetPos($hGUI, "", $cTab)
    Local $iTabWidth = Int(($aPos[2] - 3) / 2)
    Local $iTabHeight = Int(20 * $iTabWidth / 190)
    Local $iParam = BitOR(BitAND($iTabWidth, 0xFFFF), BitShift(BitAND($iTabHeight, 0xFFFF), -16))
    GUICtrlSendMsg($cTab, $TCM_SETITEMSIZE, 0, $iParam)

    GUICtrlCreatePic ("Image_path", 0, 0, 400, 300, $WS_CLIPSIBLINGS) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    GUICtrlSetState(-1, $GUI_DISABLE)

    ; Display the GUI.
    GUISetState(@SW_SHOW, $hGUI)

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd

    ; Delete the previous GUIs and all controls.
    GUIDelete($hGUI)
EndFunc   ;==>Example
I hope that helps. :)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thanks Melba for coming through.  Nice to have you looked at my thread.  I think what you've suggested should do it.

Cheers!

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

  • Similar Content

    • By red0fireus
      Hello, I'm a college student, and I have a Surface Book 2. Currently Microsoft has a stick up their ass and Windows Surface Books, after the 1903 windows update, have issues where the graphics card disconnects from the computer for no reason. (They still haven't fixed it)
      I have the Surface Book 2 13.5 Inch with a 1050 graphics card.
      I was looking for a fix online and decided to code something to try and fix it. I found that if I scan for hardware changes on the Device Manager then the graphics card will reappear. *Face Palm* I went and downloaded Devcon.exe last night and looked for example code online on how to check if a device no longer exists and if it doesn't then do "devcon rescan" and I'm going to assume this works. 
       
      If anyone has any better ideas, please post some. I've checked Reddit on how to fix this, and I've installed the Surface Book 2 Drivers. No Luck. Any recommendations would be helpful
      Things I've tried:
      Updating Windows to the Skip Beta version Reinstalling the Drivers multiple times with many different scenarios Checking for Updates (A lot) Uninstalling Software Running software as Administrator Cleaning the Devices Metal connector with Isopropyl alcohol 91% (Someone recommended it on Reddit) Installing the new NVIDIA graphic drivers (this just made it worse) Current Drivers: NVIDIA Update 31.1.10.0 NVIDIA Graphics Driver 391.40 Uninstalling the Graphic Drivers in Safe Mode with DDU Uninstaller #include "DeviceAPI.au3" $DeviceName = "NVIDIA Geforce GTX 1050" $DeviceClass = "Display adapters" ;$objWMIService = ObjGet("winmgmts:" & $strComputer & "rootCIMV2") ;$m_MediaConnectWatcher = $objWMIService.ExecNotificationQuery("SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_DiskDrive'") Do ConsoleWrite(@CRLF & "Checking for [" & $DeviceName & "]...") Sleep(5000) Until HWDevice_Detect($DeviceName, $DeviceClass) = True Func HWDevice_Detect($devicename, $classname) Local $DeviceListed = False Local $aClasses = _DeviceAPI_GetClassArray() For $X = 0 to Ubound($aClasses)-1 If $aClasses[$X][2] = $classname Then Local $aDevices = _DeviceAPI_GetDeviceArray($aClasses[$X][0]) For $Y = 0 to Ubound($aDevices)-1 If $aDevices[$Y][1] = $devicename Then $DeviceListed = True EndIf Next EndIf Next If $DeviceListed = True Then Sleep(1000) Else Run(@Comspec & " /c " & "devcon rescan") EndIf EndFunc This is the code i found and i tried to edit it but it doesn't work for what i need. It exits after it's true. I need it to constantly scan (and not cause high CPU usage) if that's possible. I was thinking scan every 15min?
      Proof of issue: Link Here to Microsoft
    • By kellariluukku
      Hello.
      I'm using SciTE v3.3.14.5 I think, and I find this very annoying (GIF):
      https://i.gyazo.com/e60b5d94b8c16d217be4010e208d7042.mp4
       
      I've searched around but found nothing that helped including this:
      https://www.autoitscript.com/forum/topic/100517-stop-scite-removing-tab-indentations/
       
      So the problem obviously is that when I go to a new line after "EndIf", it removes the tab which I don't want to happen.
      Is there any fix?
       
      I've tried to change some configs such as 
          Line 183: # Indentation     Line 185: indent.size=0     Line 187: #indent.auto=0     Line 188: indent.automatic=0     Line 189: indent.opening=0     Line 190: indent.closing=0     Line 191: #tab.indents=0     Line 192: #backspace.unindents=0 strip.trailing.spaces=0 But nothing seems to get rid of this.
       
      Thanks
    • By TheAutomator
      Is there a (simple) way to make your script using a picture-control to resize the gui?
      This would be useful for a transparant pop-up window with a custom made theme using picture controls:
      $Form = GUICreate('', 301, 173, 5, 5, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) GUICtrlCreatePic(@scriptdir & "\resize_win.bmp", 0, 73, 20, 51) ; some api call or code telling the os to use this picture as a resize border GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUISetState(@SW_SHOW) While True if GUIGetMsg() = $GUI_EVENT_CLOSE then Exit WEnd  
      EDIT: to make it more clear what i wanna do, if you go with the mouse arrow over the border of a re-sizable window the arrow changes to a "resize" arrow, you click and drag the border and then the window size adjusts to the mouse position until you release the mouse button.
      I want my picture control to be used the same way as the resize border to resize my window.
    • By nacerbaaziz
      Hi dears
      I've got a question in creating tabs in autoit
      Usually in other programs you can move between tabs by pressing ctrl + tab or ctrl + shift + tab
      I tried to create a window  which have a multy  tab but when i press one of the shortcuts
      it does not move between the tabs
      Is there an option to enable or disable this
      Greetings
      this is the example i tryed

      #include <GUIConstants.au3> #include <MsgBoxConstants.au3> #include <TabConstants.au3> #include <ComboConstants.au3> #include <WindowsConstants.au3> #include <GuiComboBox.au3> effectsSettings() func effectsSettings() local $echoCombo[6], $reverbCombo[5],  $CHORUSCombo[8], $flangerCombo[8], $paramEQCombo[4], $distortionCombo[6], $gargleCombo[3] $EffWindow = GUICreate("efects settings", 400, 400, -1, -1, $WS_TABSTOP) local $BtOK = GUICtrlCreateButton("ok", 5, 360, 50, 30, 0x01) GUIStartGroup("") local $BTCancel = GUICtrlCreateButton("cancel", 340, 360, 50, 30) GUIStartGroup("") local $effectTabs =     GUICtrlCreateTab(10, 10, 380, 70) GUICtrlSetState(-1, $GUI_focus)     GUICtrlCreateTabItem("echo") GUICtrlCreateLabel("fWetDryMix", 50, 100, 100, 60) $echoCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fFeedback", 180, 100, 100, 60) $echoCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fLeftDelay", 290, 100, 100, 60) $echoCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fRightDelay", 50, 180, 100, 60) $echoCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("lPanDelay", 180, 180, 100, 60) $echoCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40)     GUICtrlCreateTabItem("reverb") GUICtrlCreateLabel("fInGain", 50, 100, 100, 60) $ReverbCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fReverbMix", 180, 100, 100, 60) $ReverbCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fReverbTime", 290, 100, 100, 60) $ReverbCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fHighFreqRTRatio", 50, 180, 100, 60) $ReverbCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40)     GUICtrlCreateTabItem("chorus") GUICtrlCreateLabel("fWetDryMix", 50, 100, 100, 60) $ChorusCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fDepth", 180, 100, 100, 60) $ChorusCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fFeedback", 290, 100, 100, 60) $ChorusCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fFrequency", 50, 180, 100, 60) $ChorusCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("lWaveform", 180, 180, 100, 60) $ChorusCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40) GUICtrlCreateLabel("fDelay", 290, 180, 100, 60) $ChorusCombo[6] = GUICtrlCreateCombo("", 300, 190, 80, 40) GUICtrlCreateLabel("lPhase", 50, 260, 100, 60) $ChorusCombo[7] = GUICtrlCreateCombo("", 60, 270, 80, 40)     GUICtrlCreateTabItem("flanger") GUICtrlCreateLabel("fWetDryMix", 50, 100, 100, 60) $FlangerCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fDepth", 180, 100, 100, 60) $FlangerCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fFeedback", 290, 100, 100, 60) $FlangerCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fFrequency", 50, 180, 100, 60) $FlangerCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("lWaveform", 180, 180, 100, 60) $FlangerCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40) GUICtrlCreateLabel("fDelay", 290, 180, 100, 60) $FlangerCombo[6] = GUICtrlCreateCombo("", 300, 190, 80, 40) GUICtrlCreateLabel("lPhase", 50, 260, 100, 60) $FlangerCombo[7] = GUICtrlCreateCombo("", 60, 270, 80, 40)     GUICtrlCreateTabItem("paramatric eq") GUICtrlCreateLabel("fCenter", 50, 100, 100, 60) $parameqCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fBandwidth", 180, 100, 100, 60) $ParamEqCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fGain", 290, 100, 100, 60) $parameqCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40)     GUICtrlCreateTabItem("distortion") GUICtrlCreateLabel("fGain", 50, 100, 100, 60) $distortionCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fEdge", 180, 100, 100, 60) $distortionCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fPostEQCenterFrequency", 290, 100, 100, 60) $distortionCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fFrequency", 50, 180, 100, 60) $distortionCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("fPostEQBandwidth", 180, 180, 100, 60) $distortionCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40)     GUICtrlCreateTabItem("gargle") GUICtrlCreateLabel("dwRateHz", 50, 100, 100, 60) $gargleCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("dwWaveShape", 180, 100, 100, 60) $gargleCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUISetState(@sw_show, $EffWindow) While 1 Switch GUIGetMSG() case $GUI_Event_close, $BTCancel exit EndSwitch Wend return "" endFunc
    • By Sven-Seyfert
      Hi Community,

      I'm looking for a way to do a Video Overlay GUI or something like that. The idea is to create a GUI which plays a video loop (with transparency/alpha channel) in front of an other GUI. Before you asking why - because I don't believe that GDIPlus can do it out of the box. My skillset for that kind of graphical things isn't good enough to do that, but here are some specialist like @UEZ maybe who can help.

      Example alpha channel video (visualized as animated *.gif):

      I tried to do the light rays effect directly with GDIPlus, but honestly that's a bit too difficult for me. I would be very glad and grateful if there are some suggestions, ideas or recommendations.

      Code for the Video play:
       
      Example video "End.mpeg":
       
      The next challenge is that the overlay GUI should be not clickable. If I hover over the overlay area, I want to have the possibility to control the GUI or what ever, in the background. But if there is any chance to make it with GDIPlus as a Video Overlay for light rays, I would prefer that approach instead of my crazy work-around idea.

      Thanks for any suggestion - I'm grateful!
      Sven
×
×
  • Create New...