Jump to content

Rotate a "»" symbol to use for download button


Kostadin
 Share

Recommended Posts

Hello everyone, is it possible rotation of some specific symbols, like a « , » , ‹ , › , so that GUI button looks like a download button?

My exaple GUI:

#include <GUIConstantsEx.au3>

Example()

Func Example()
Local $Button_1, $Button_2, $msg
GUICreate("Rotate DL button",256,48) ; will create a dialog box that when displayed is centered

$Button_1 = GUICtrlCreateButton("»", 10, 10, 24, 24)
$Button_2 = GUICtrlCreateButton("Exit", 44, 10, 96, 24)

GUISetState()    ; will display an dialog box with 2 button

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1
ShellExecute("http://fpdownload.macromedia.com/get/flashplayer/current/licensing/win/install_flash_player_11_plugin_32bit.exe")
Case $msg = $Button_2
ExitLoop
EndSelect
WEnd
EndFunc ;==>Example
Link to comment
Share on other sites

;#include <GDIPlus.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>

; http://www.autoitscript.com/forum/index....=&showtopic=93289&view=findpos
Local $nAngle = 281
Local $nPI = 4 * ATan(1)

Opt("GUIOnEventMode", 1) ;0=disabled, 1=OnEvent mode enabled

$GUI = GUICreate("GDI+", 400, 400)
GUISetOnEvent(-3, "_Quit")
GUISetState()

;$graph = GUICtrlCreateGraphic(0, 0, 400, 400)

;point GDI graphic to GUICtrlCreateGraphic with 270 DEG rotation
_GDIPlus_Startup()
;$hGraph = ControlGetHandle($GUI, "", $graph)
$GDI = _GDIPlus_GraphicsCreateFromHWND($GUI)
$hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixRotate($hMatrix, $nAngle, False)
_GDIPlus_GraphicsSetTransform($GDI, $hMatrix)


Vstring("Hello world!", 100, 150, 12, $nAngle)


While 1
Sleep(250^3)
WEnd

Func VString($txt, $nx, $ny, $size, $nAngle)
;draw string with x,y = upper left corner
;Rotation of Coordinate Axes formulae
$nXt = $nx * Cos($nAngle * $nPI / 180) + $ny * Sin($nAngle * $nPI / 180) ; $nXt - X coordinate before translation
$nYt = -$nx * Sin($nAngle * $nPI / 180) + $ny * Cos($nAngle * $nPI / 180) ; $nYt - Y coordinate before translation
_GDIPlus_GraphicsDrawString($GDI, $txt, $nXt, $nYt, "Arial", $size, 0x0002)
EndFunc ;==>VString

Func _Quit()
_GDIPlus_GraphicsDispose($GDI)
_GDIPlus_MatrixDispose($hMatrix)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>_Quit

I havent yet tested

You can try the Handle of a Label instead of the GUI and then try making the text of the Label as

»

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

Use another font:

Global $hGui1 = GuiCreate("AutoIt Main-GUI", 300, 340, 100, 100, -1, 0);

GUICtrlCreateButton("Ú", 10, 10, 24, 24)
GUICtrlSetFont(-1, 15, Default, Default, "Wingdings")
GUICtrlCreateButton("Þ", 10, 40, 24, 24)
GUICtrlSetFont(-1, 15, Default, Default, "Wingdings")
GUICtrlCreateButton("ê", 10, 70, 24, 24)
GUICtrlSetFont(-1, 15, Default, Default, "Wingdings")
GUICtrlCreateButton("ò", 10, 100, 24, 24)
GUICtrlSetFont(-1, 15, Default, Default, "Wingdings")
GUICtrlCreateButton("â", 10, 130, 24, 24)
GUICtrlSetFont(-1, 15, Default, Default, "Wingdings")

GuiSetState(@SW_SHOW, $hGui1);

Do
Until GUIGetMsg() = -3

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

Link to comment
Share on other sites

completing funkey's list...

GUICreate("Rotate DL button",380, 100)

GUISetFont(10, 600, 0, "Symbol")
GUICtrlCreateButton(Chr(173), 10, 10, 26, 26)
GUICtrlCreateButton(Chr(175), 40, 10, 26, 26)
GUICtrlCreateButton(Chr(217), 70, 10, 26, 26)
GUICtrlCreateButton(Chr(218), 100, 10, 26, 26)
GUISetFont(14, 600, 0, "Symbol")
GUICtrlCreateButton(Chr(221), 130, 10, 26, 26)
GUICtrlCreateButton(Chr(223), 160, 10, 26, 26)

GUISetFont(18, 400, 0, "Wingdings")
GUICtrlCreateButton(Chr(71), 10, 40, 26, 26)
GUICtrlCreateButton(Chr(72), 40, 40, 26, 26)
GUISetFont(12, 400, 0, "Wingdings")
GUICtrlCreateButton(Chr(217), 130, 40, 26, 26)
GUICtrlCreateButton(Chr(218), 160, 40, 26, 26)
GUISetFont(16, 400, 0, "Wingdings")
GUICtrlCreateButton(Chr(221), 70, 40, 26, 26)
GUICtrlCreateButton(Chr(222), 100, 40, 26, 26)
GUISetFont(12, 400, 0, "Wingdings")
GUICtrlCreateButton(Chr(225), 190, 40, 26, 26)
GUICtrlCreateButton(Chr(226), 220, 40, 26, 26)
GUICtrlCreateButton(Chr(233), 250, 40, 26, 26)
GUICtrlCreateButton(Chr(234), 280, 40, 26, 26)
GUICtrlCreateButton(Chr(241), 310, 40, 26, 26)
GUICtrlCreateButton(Chr(242), 340, 40, 26, 26)

GUISetFont(18, 400, 0, "Webdings")
GUICtrlCreateButton(Chr(53), 10, 70, 26, 26)
GUICtrlCreateButton(Chr(54), 40, 70, 26, 26)

GUISetState()
While GUIGetMsg() <> -3
WEnd

Edit: more completely completing the now completed(?) list...

Edited by Spiff59
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...