Jump to content

Down arrow button


Recommended Posts

Find a left/right or Up button and rotate it.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I think you'd need to custom draw buttons like the ones your after or use images to load as buttons

I tried toying with gdi+ to draw the button and just set the drawn image onto a Pic control..lol

#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>

Opt('MustDeclareVars', 1)

Global $hGUI, $Pic, $hGraphic, $hPen, $hBrush, $hBitmap1, $hBitmap2, $hImage1, $hImage2
Global $hBMP1, $hBMP2, $msg, $GGCI, $Last, $State

    
$hGUI = GUICreate("GDI+", 400, 300)
$Pic = GUICtrlCreatePic("", 10, 10, 31, 31)
GUISetState()

_GDIPlus_Startup ()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND(GUICtrlGetHandle($Pic))
    
;Create 2 empty images for the mouse over the button
$hBitmap1 = _GDIPlus_BitmapCreateFromGraphics(31, 31, $hGraphic)
$hImage1 = _GDIPlus_ImageGetGraphicsContext($hBitmap1)
_GDIPlus_GraphicsSetSmoothingMode($hImage1, 2)
    
$hBitmap2 = _GDIPlus_BitmapCreateFromGraphics(31, 31, $hGraphic)
$hImage2 = _GDIPlus_ImageGetGraphicsContext($hBitmap2)
_GDIPlus_GraphicsSetSmoothingMode($hImage2, 2)  
    
;Create a pen and a brush to draw stuff onto the empty images
$hPen = _GDIPlus_PenCreate(0x550000CC)
$hBrush = _GDIPlus_BrushCreateSolid(0x11000022)

;Draw a circle outline and a solid circle for the first buton
_GDIPlus_GraphicsDrawEllipse ($hImage1, 0, 0, 30, 30, $hPen)
_GDIPlus_GraphicsFillEllipse ($hImage1, 0, 0, 30, 30, $hBrush)

;Change the brush color for the 2nd image and draw 2 circles the same as the first.
_GDIPlus_BrushSetSolidColor($hBrush, 0x44000022)
_GDIPlus_GraphicsDrawEllipse ($hImage2, 0, 0, 30, 30, $hPen)
_GDIPlus_GraphicsFillEllipse ($hImage2, 0, 0, 30, 30, $hBrush)

;Change the Pen color and draw the down arrow on both images
_GDIPlus_PenSetWidth($hPen, 2)
_GDIPlus_PenSetColor($hPen, 0xBB000000)
_GDIPlus_GraphicsDrawLine ($hImage1, 5, 10, 15, 20, $hPen)
_GDIPlus_GraphicsDrawLine ($hImage1, 15, 20, 25, 10, $hPen)
_GDIPlus_GraphicsDrawLine ($hImage2, 5, 10, 15, 20, $hPen)
_GDIPlus_GraphicsDrawLine ($hImage2, 15, 20, 25, 10, $hPen) 
    
;Create 2 hBitmaps so you can set the Pic control with the newly drawn image
_GDIPlus_GraphicsDrawImageRect($hImage1, $hBitmap1, 0, 0, 31, 31)
_GDIPlus_GraphicsDrawImageRect($hImage2, $hBitmap2, 0, 0, 31, 31)
$hBMP1 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap1)
$hBMP2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap2)
    
;Send the newly drawn 1st image to the Pic control
GUICtrlSendMsg($Pic, 0x0172, 0, $hBMP1)
    
;We now have our 2 hBitmaps for the Pic control.
;Finished with GDI+ clean up and shut it down.
_GDIPlus_ImageDispose ($hImage1)
_GDIPlus_ImageDispose ($hImage2)
_WinAPI_DeleteObject($hBitmap1)
_WinAPI_DeleteObject($hBitmap2)
_WinAPI_DeleteObject($hPen)
_GDIPlus_BrushDispose ($hBrush)
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_Shutdown ()
    
While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ;delete the 2 hBitmap images on shutdown of the script.
            _WinAPI_DeleteObject($hBMP1)
            _WinAPI_DeleteObject($hBMP2)
            Exit
        Case $Pic
            ;User clicked the Pic Control
            MsgBox(0, "Clicked", "Button Clicked!")
        Case Else
            ;Change Pic if the mouse is over or not over the Pic control
            $GGCI = GUIGetCursorInfo($hGui)
            If $GGCI[4] <> $Last And $State Then
                GUICtrlSetImage($Pic, "")
                GUICtrlSendMsg($Pic, 0x0172, 0, $hBMP1)
                $State = 0
                $Last = $GGCI[4]
            ElseIf $GGCI[4] <> $Last And Not $State Then
                GUICtrlSetImage($Pic, "")
                GUICtrlSendMsg($Pic, 0x0172, 0, $hBMP2)
                $State = 1
                $Last = $GGCI[4]
            EndIf
    EndSwitch
WEnd    


;Just a GDI_Plus brush function that needs to be included in AutoIt's GDI+ udf..
Func _GDIPlus_BrushSetSolidColor($hBrush, $iARGB = 0xFF000000)
    Local $aResult

    $aResult = DllCall($ghGDIPDll, "int", "GdipSetSolidFillColor", "hwnd", $hBrush, "int", $iARGB)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
EndFunc   ;==>_GDIPlus_BrushSetSolidColor
Edited by smashly
Link to comment
Share on other sites

  • Moderators

toxicdav3,

Find a suitable arrow-like character in a font and put it on the button:

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 500, 500)

$hBut_1 = GUICtrlCreateButton(Chr(0x70),10, 10, 20, 20)
GUICtrlSetFont(-1, 10, 600, -1, "WingDings 3")
$hBut_1 = GUICtrlCreateButton(Chr(0x71),40, 10, 20, 20)
GUICtrlSetFont(-1, 10, 600, -1, "WingDings 3")
$hBut_1 = GUICtrlCreateButton(Chr(0x74),70, 10, 20, 20)
GUICtrlSetFont(-1, 10, 600, -1, "WingDings 3")
$hBut_1 = GUICtrlCreateButton(Chr(0x75),100, 10, 20, 20)
GUICtrlSetFont(-1, 10, 600, -1, "WingDings 3")

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

Use "Character Map" to search for a suitable arrow shape - perhaps start in "WingDings", but there are plenty more. You can also get characters for 'Play', 'Pause', 'FF', 'Rewind', and lots of other useful things. :-)

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

Now that I am at my other system, here is a set of 4 Blue on Black. You can edit them yourself.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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