Jump to content
Sign in to follow this  
JonBMN

[RESOLVED]Up and down Carets in GUICtrlCreateButton

Recommended Posts

JonBMN

I'm trying to make an up and down arrow like this " ^ ", but since there is no down caret on the keyboard I'm resorting to trying to figure out ways to get that Caret upside down.

Has anyone tried doing this for a button so that it looks like an up and down array? This button will be used for sorting.

I've tried looking through Unicode to see if I could do it and no luck :/. Any help would be much appreciated.

Edited by JonBMN

Share this post


Link to post
Share on other sites
Melba23

JonBMN,

WebDings (which I believe is standard on all Windows OSes) has suitable characters as 0x35/6 ("5" and "6"). You can use them like this (taken from one of my scripts): :)

Global $cDetails_Show_Button = GUICtrlCreateButton("5", 115, 45, 35, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Webdings") ; "5" = ^, "6" = v

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 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
Bowmore

You might also want to have a look at the Marlett font which also comes with windows. It contains many of the arrows and symbols used on standard windows dialogs.


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites
JonBMN

I've tried using your solution @Melba23, but I could not get it to work. I seem to just be getting 5 instead of the symbol.

I get the same from the Marlett font @Bowmore.

I must be doing something wrong. So, here is an example of what I'm doing..

GUICtrlSetFont($ButtonAZ, -1, 10, 600, -1, "Webdings")
$ButtonAZ = GUICtrlCreateButton("5", 250, 5)
Edited by JonBMN

Share this post


Link to post
Share on other sites
Melba23

JonBMN,

Create the button before you set the font as I did in my code. ;)

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 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
JonBMN

I just tested out creating the button before I set the font, but I still get the same thing.

$ButtonAZ = GUICtrlCreateButton("5", 250, 5)
GUICtrlSetFont($ButtonAZ, -1, 10, 600, -1, "Webdings")

Do you think I don't have this font?

Edited by JonBMN

Share this post


Link to post
Share on other sites
Melba23

JonBMN,

You have the syntax wrong - you use either the button ControlID or the "-1" shorthand for "last control created", but not both Try this: ;)

GUICtrlSetFont($ButtonAZ, 10, 600, -1, "Webdings")

M23

Edited by Melba23
Fixed BB tags

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 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
JonBMN

Ah, I see!

Thank you Melba, it works :)

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  

  • Similar Content

    • Yirrlaar
      By Yirrlaar
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("MyCommands", 406, 236, 610, 129) $Main = GUICtrlCreateTab(8, 8, 385, 217) $TabSheet1 = GUICtrlCreateTabItem("Main") $StopFunc = GUICtrlCreateButton("STOP", 17, 43, 150, 50) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $StartFunc = GUICtrlCreateButton("Start", 17, 98, 150, 50) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $Input0 = GUICtrlCreateInput("Input0", 267, 43, 75, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Input1 = GUICtrlCreateInput("Input1"", 267, 73, 75, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Input2 = GUICtrlCreateInput("Input2", 267, 103, 75, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Input3 = GUICtrlCreateInput("Input3", 267, 133, 75, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Input4 = GUICtrlCreateInput("Input4", 267, 163, 75, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Input5 = GUICtrlCreateInput("Input5", 267, 195, 75, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Label1 = GUICtrlCreateLabel("Label1", 215, 43, 50, 20, $SS_RIGHT) GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Label2", 215, 73, 50, 20, $SS_RIGHT) GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif") $Label3 = GUICtrlCreateLabel("Label3", 215, 103, 50, 20, $SS_RIGHT) GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif") $Label4 = GUICtrlCreateLabel("Label4", 215, 133, 50, 20, $SS_RIGHT) GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif") $Label5 = GUICtrlCreateLabel("Label5", 215, 163, 50, 20, $SS_RIGHT) GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif") $Label6 = GUICtrlCreateLabel("Label6", 191, 195, 74, 20, $SS_RIGHT) GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif") $TabSheet2 = GUICtrlCreateTabItem("Individuals") $Button1 = GUICtrlCreateButton("Button1", 17, 43, 75, 25) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $StartBOT letsdothis() Case $StopBOT END_This() EndSwitch WEnd func letsdothis() While 1 ;doing stuff ;doing more stuff if $StopFunc Then END_This() ;how do i detect if the button has been pressed if $Button1 Then Sleepy_Time() ;doing things ;doing more things WEnd EndFunc Func Sleepy_Time() while 1 sleep(10) if $Button1 Then ExitLoop ; detect button press and return to previous state Wend EndFunc Func END_This() Exit EndFunc For the LIFE of me I can't figure out, HOW ON EARTH to detect that a button has been pressed while a function is running?
      Can someone PLEASE point me in the right direction???
      Thanks
    • John C.
      By John C.
      ;Adding $BS_DEFPUSHBUTTON doesn't work
              $idCopy_Data = GUICtrlCreateButton("Copy Data Only", $iButtonWidth_2, $aiGUISize[1] - $iButtonMargin, $iButtonWidth_2, 20, $BS_DEFPUSHBUTTON)
      ;Adding these two lines doesn't work either
               Local $aAccelKeys[2][2] = [["{enter}", $idCopy_Data], ["^{enter}", $idCopy_ID]]
              GUISetAccelerators($aAccelKeys)
       
    • 232showtime
      By 232showtime
      Hi need some help with the space between two buttons, if I ran the script the space between two buttons is gone and when I maximized the gui, space between two button is showing,
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $hGUI1 = GUICreate("Test", 1090, 800, 200, 200, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP, $WS_HSCROLL, $WS_VSCROLL)) $TopRight1 = GUICtrlCreateButton("Test1", 800, 25, 70, 50) $TopRight2 = GUICtrlCreateButton("Test2", 850, 25, 70, 50) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd this is the first time I encounter this problem.
    • suntisuka
      By suntisuka
      Hello expert,
      I want to write function that change caret for any textbox/combobox in any windows. I never write Windows Programming before. After trying many hours, I found code that close to my need from the example of   _WinAPI_CreateCaret function   in AutoIt help file. It captures WM_COMMAND (I don't know what is it) and changes caret. But this example change only caret in its own form, not for all windows. Could you please guide me how to do what I need.
      Thanks in advanced.
      Suntisuk
    • JuanFelipe
      By JuanFelipe
      Hi friends, I need help with the process, I have a button to initiate a code but do not know how to configure it to be the button to start the process, thank you very much for your help.
      Here I leave the code to see if I have to change some part.
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\juan.caballeron\desktop\ \programacion\autoit\capturas\koda_1.7.3.0\forms\grabar capturas.kxf $Form1_1 = GUICreate("WhiteSnake", 655, 487, 192, 124) GUISetIcon("C:\Users\juan.caballeron\Desktop\ \Programacion\Autoit\Capturas\koda_1.7.3.0\iconos\Avatar on ice-256.ico", -1) GUISetBkColor(0xC8C8C8) $hechos = GUICtrlCreateGroup("Hechos", 16, 32, 385, 169) GUICtrlSetColor(-1, 0x000000) $box_fechah = GUICtrlCreateInput("", 112, 72, 81, 21) GUICtrlSetLimit(-1, 10) $box_hora = GUICtrlCreateInput("", 112, 104, 81, 21) GUICtrlSetLimit(-1, 5) $box_fechaf = GUICtrlCreateInput("", 112, 136, 81, 21) GUICtrlSetLimit(-1, 10) $box_fte = GUICtrlCreateInput("", 112, 168, 81, 21) GUICtrlSetLimit(-1, 5) $Label3 = GUICtrlCreateLabel("Fecha Hecho:", 24, 72, 72, 17) $Label4 = GUICtrlCreateLabel("Hora:", 24, 104, 30, 17) $Label5 = GUICtrlCreateLabel("Fecha Fuente:", 24, 136, 73, 17) $Label6 = GUICtrlCreateLabel("Nro. Fuente:", 24, 168, 63, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $personas = GUICtrlCreateGroup("Datos de la Persona", 16, 224, 585, 185) $Label1 = GUICtrlCreateLabel("Tipo Identificación:", 32, 256, 94, 17) $Label2 = GUICtrlCreateLabel("No. Documento:", 32, 280, 82, 17) $Label7 = GUICtrlCreateLabel("Apellidos", 32, 304, 46, 17) $Label8 = GUICtrlCreateLabel("Nombres", 32, 328, 46, 17) $Label9 = GUICtrlCreateLabel("Sexo", 32, 352, 28, 17) $Label10 = GUICtrlCreateLabel("Fecha Nacimiento", 32, 376, 90, 17) $Combo1 = GUICtrlCreateCombo("Selección", 128, 256, 193, 21) $Combo1 = GUICtrlSetData(-1, "Tarjeta de Identidad|Cédula") GUICtrlSetLimit(-1, 1) $documento = GUICtrlCreateInput("", 128, 280, 193, 21) $apellidos = GUICtrlCreateInput("", 128, 304, 377, 21) $nombres = GUICtrlCreateInput("", 128, 328, 377, 21) $Combo2 = GUICtrlCreateCombo("Selección", 128, 352, 121, 21) $Combo2 = GUICtrlSetData(-1, "Masculino|Femenino") GUICtrlSetLimit(-1, 1) $fecha_naci = GUICtrlCreateInput("", 128, 376, 121, 21) GUICtrlSetLimit(-1, 10) GUICtrlCreateGroup("", -99, -99, 1, 1) $datoscap = GUICtrlCreateGroup("Datos Capturas", 456, 32, 145, 169) $Label11 = GUICtrlCreateLabel("Label11", 472, 56, 42, 17) $Label12 = GUICtrlCreateLabel("Label12", 472, 80, 42, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Titulo = GUICtrlCreateLabel("PROCESO PARA GRABAR CAPTURAS EN EL SIEDCO.", 175, 8, 277, 17, $SS_CENTER) GUICtrlSetCursor (-1, 3) $Progress1 = GUICtrlCreateProgress(448, 432, 169, 9) GUICtrlSetCursor (-1, 15) $creador = GUICtrlCreateLabel("By WhiteSnake", 8, 440, 78, 17) GUICtrlSetColor(-1, 0xFF0000) $Icon1 = GUICtrlCreateIcon("C:\Users\juan.caballeron\Desktop\ \Programacion\Autoit\Capturas\koda_1.7.3.0\iconos\1249549841170809086.ico", -1, 88, 432, 32, 32) $iniciar = GUICtrlCreateButton("INICIAR PROCESO", 296, 424, 145, 25) GUICtrlSetCursor (-1, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd  
      I just need to know how to do that when you click the $iniciar start any process.
×