Jump to content

Combo Box


Recommended Posts

  • Moderators

FinalVersion,

Please post the code that produced them and we can take a look. :mellow:

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

 

Link to comment
Share on other sites

And by look better, I'm mean look more like Steam combo boxes.

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$frmMain = GUICreate("frmMain", 274, 173, -1, -1, BitOR($WS_SYSMENU,$WS_POPUP,$WS_CLIPSIBLINGS))
$lblCaption = GUICtrlCreateLabel("Counter-Strike:Source Launcher", 8, 8, 188, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
$cHeapsize = GUICtrlCreateCombo("cHeapsize", 96, 40, 145, 25)
$lblHeapsize = GUICtrlCreateLabel("Heapsize:", 16, 40, 51, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$lbldxlevel = GUICtrlCreateLabel("Direct X Level", 16, 72, 69, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$cDxlevel = GUICtrlCreateCombo("cDxlevel", 96, 72, 145, 25)
$lblWindowed = GUICtrlCreateLabel("Windowed", 16, 104, 54, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$chkWindowed = GUICtrlCreateCheckbox("", 104, 104, 17, 17)
$btnClose = GUICtrlCreatePic("C:\Users\Scott\Programming\AutoIt\CSS Launcher\Images\close_button.bmp", 256, 8, 11, 11, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$btnMinimize = GUICtrlCreatePic("C:\Users\Scott\Programming\AutoIt\CSS Launcher\Images\minimize_button.bmp", 240, 13, 13, 6, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$btnLaunch = GUICtrlCreatePic("C:\Users\Scott\Programming\AutoIt\CSS Launcher\Images\launch_button.bmp", 80, 136, 76, 24, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$btnSave = GUICtrlCreatePic("C:\Users\Scott\Programming\AutoIt\CSS Launcher\Images\save_button.bmp", 168, 136, 76, 24, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
GUISetBkColor(0x5a6a50)
GUICtrlSetBkColor($cHeapsize, 0x5a6a50)
GUICtrlSetBkColor($cDxlevel, 0x5a6a50)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $btnClose
            Exit
        Case $btnMinimize
            GUISetState(@SW_MINIMIZE)
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Link to comment
Share on other sites

#include <WindowsConstants.au3>
#include <ComboConstants.au3>

$Form1 = GUICreate("Form1", 122, 133, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS))
$Combo1 = GUICtrlCreateCombo("", 8, 8, 105, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Combo2 = GUICtrlCreateCombo("", 8, 32, 105, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Combo3 = GUICtrlCreateCombo("", 8, 56, 105, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Label1 = GUICtrlCreateLabel("Normal text", 8, 88, 57, 17)
$Label2 = GUICtrlCreateLabel("Special text", 8, 112, 59, 17)
GUISetBkColor(0x4C5844)
GUICtrlSetData($Combo1,"1|2|3","2")
GUICtrlSetData($Combo2,"1|2|3","2")
GUICtrlSetData($Combo3,"1|2|3","2")
GUICtrlSetBkColor($Combo1,0x3E4637)
GUICtrlSetBkColor($Combo2,0x3E4637)
GUICtrlSetBkColor($Combo3,0x3E4637)
GUICtrlSetColor($Combo1,0xD8DED3)
GUICtrlSetColor($Combo2,0xD8DED3)
GUICtrlSetColor($Combo3,0xD8DED3)
GUICtrlSetColor($Label1,0xA0AA95)
GUICtrlSetColor($Label2,0xC4B550)
GUISetState(@SW_SHOW)

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd

This is the best I could achieve

Link to comment
Share on other sites

  • Moderators

FinalVersion,

Pardon the question, but before we start - can you assure me that this does not fall under the "no bot" rule? I only ask because as a non-gamer, my antennae quiver whenever I see things like "Counter-Strike:Source Launcher".

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

 

Link to comment
Share on other sites

Posted Image

#include <WindowsConstants.au3>
#include <ComboConstants.au3>

$Form1 = GUICreate("Form1", 300, 400, -1, -1, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
;frame:
GUICtrlCreatePic("frame1.bmp",0,0,300,2)
GUICtrlCreatePic("frame2.bmp",298,0,2,400)
GUICtrlCreatePic("frame3.bmp",0,398,300,2)
GUICtrlCreatePic("frame4.bmp",0,0,2,400)
;
$Combo1 = GUICtrlCreateCombo("", 8, 8, 105, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Combo2 = GUICtrlCreateCombo("", 8, 32, 105, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Combo3 = GUICtrlCreateCombo("", 8, 56, 105, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Label1 = GUICtrlCreateLabel("Normal text", 8, 88, 57, 17)
$Label2 = GUICtrlCreateLabel("Special text", 8, 112, 59, 17)
GUISetBkColor(0x4C5844)
GUICtrlSetData($Combo1,"1|2|3","2")
GUICtrlSetData($Combo2,"1|2|3","2")
GUICtrlSetData($Combo3,"1|2|3","2")
GUICtrlSetBkColor($Combo1,0x3E4637)
GUICtrlSetBkColor($Combo2,0x3E4637)
GUICtrlSetBkColor($Combo3,0x3E4637)
GUICtrlSetColor($Combo1,0xD8DED3)
GUICtrlSetColor($Combo2,0xD8DED3)
GUICtrlSetColor($Combo3,0xD8DED3)
GUICtrlSetColor($Label1,0xA0AA95)
GUICtrlSetColor($Label2,0xC4B550)
GUISetState(@SW_SHOW)

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd

frames.rar

Link to comment
Share on other sites

  • Moderators

Finalversion,

Apologies for asking - no offence meant. :(

Here are some slightly better combos - I have removed the default theme from the upper combo which enables us to colour it a bit better. You should be able to see how it was done and apply it to the other yourself:

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$frmMain = GUICreate("frmMain", 274, 173, -1, -1, BitOR($WS_SYSMENU,$WS_POPUP,$WS_CLIPSIBLINGS))
GUISetBkColor(0x5a6a50)
$lblCaption = GUICtrlCreateLabel("Counter-Strike:Source Launcher", 8, 8, 188, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
$cHeapsize = GUICtrlCreateCombo("cHeapsize", 96, 40, 145, 25)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($cHeapsize), "wstr", 0, "wstr", 0)
GUICtrlSetColor($cHeapsize, 0x00ff00)
GUICtrlSetBkColor($cHeapsize, 0x5a6a50)
$lblHeapsize = GUICtrlCreateLabel("Heapsize:", 16, 40, 51, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$lbldxlevel = GUICtrlCreateLabel("Direct X Level", 16, 72, 69, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$cDxlevel = GUICtrlCreateCombo("cDxlevel", 96, 72, 145, 25)
GUICtrlSetBkColor($cDxlevel, 0x5a6a50)
$lblWindowed = GUICtrlCreateLabel("Windowed", 16, 104, 54, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$chkWindowed = GUICtrlCreateCheckbox("", 104, 104, 17, 17)
$btnClose = GUICtrlCreatePic("C:\Users\Scott\Programming\AutoIt\CSS Launcher\Images\close_button.bmp", 256, 8, 11, 11, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$btnMinimize = GUICtrlCreatePic("C:\Users\Scott\Programming\AutoIt\CSS Launcher\Images\minimize_button.bmp", 240, 13, 13, 6, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$btnLaunch = GUICtrlCreatePic("C:\Users\Scott\Programming\AutoIt\CSS Launcher\Images\launch_button.bmp", 80, 136, 76, 24, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$btnSave = GUICtrlCreatePic("C:\Users\Scott\Programming\AutoIt\CSS Launcher\Images\save_button.bmp", 168, 136, 76, 24, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        ;Case $btnClose
        ;    Exit
        ;Case $btnMinimize
        ;    GUISetState(@SW_MINIMIZE)
         Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

What is left is the 3-D border. These colours can be set globally by using the _WinAPI_Get/SetSysColor commands - I would imagine you need these parameters:

$COLOR_3DHIGHLIGHT - Highlight color for three-dimensional display elements (for edges facing the light source.)

$COLOR_3DHILIGHT - Highlight color for three-dimensional display elements (for edges facing the light source.)

$COLOR_3DLIGHT - Light color for three-dimensional display elements (for edges facing the light source.)

$COLOR_3DSHADOW - Shadow color for three-dimensional display elements (for edges facing away from the light source).

But bear in mind that these affect ALL 3-D objects on your system, not just the current GUI - mess with them at your peril. :mellow: So as not to frighten you off completely, I have always found that the default system colours are reset when you reboot - it got me quite concerned the first time I tried to change anything!

I hope this helps a bit. :lol:

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

 

Link to comment
Share on other sites

Thanks, but I'm not that worried about minor details. Here is what I have so far.

Posted Image

Edit:

@M23

Where getting somewhere :mellow:

Edit2:

I was thinking maybe of having a look at some steam resources(Dll's etc).

Edited by FinalVersion
Link to comment
Share on other sites

  • Moderators

FinalVersion,

I am pretty sure that the combos you want to emulate are custom-drawn controls - which requires a great deal of GDI to emulate. I imagine it might be possible in AutoIt, but it is certainly well beyond my capability. In any event I would hazard a guess that the code overhead for something as complicated as an ower-drawn combobox would be prohibitive.

Good luck with the searching - let us know if you find anything. :mellow:

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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...