Jump to content

vertical label ?


Recommended Posts

hi

#include <GUIConstantsEx.au3>

#include <ProgressConstants.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("[#] Form1 [#]", 633, 447, 192, 124)

$Label1 = GUICtrlCreateLabel("Autoit team", 40, 112, 57, 17) how is vertical label ?or flip label control ?

$Progress1 = GUICtrlCreateProgress(104, 192, 177, 49, BitOR($PBS_SMOOTH,$PBS_VERTICAL))like it ($PBS_VERTICAL)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

thank you for help me

Link to comment
Share on other sites

Here a routine made by BugFix (I put it to a function):

;Thanks to BugFix
Func Display_Rotated_Text($hGUI, $text, $px, $py, $angle = 90, $tw = 400, $th = 12, $tcolor = 0x000000, $bcolor = 0xF0F0F0, $font = 'Arial', $transparent = True)
    Local $tRect, $rotate, $RotateMe, $rFont, $hDC

    ; Create RECT-structure, fill data
    $tRect = DllStructCreate ($tagRECT)
    DllStructSetData ($tRect, 'Left', $px)
    DllStructSetData ($tRect, 'Top', $py)

    ; Set rotation
    $rotate = $angle * 10

    ; Create structure for rotate text, fill data
    $RotateMe = DllStructCreate ($tagLOGFONT)
    DllStructSetData ($RotateMe, 'Escapement', $rotate)
    DllStructSetData ($RotateMe, 'Weight', $tw)
    DllStructSetData ($RotateMe, 'Height', $th)
    DllStructSetData ($RotateMe, 'FaceName', $font)

    ; Creates a logical font that has specific characteristics
    $rFont = _WinAPI_CreateFontIndirect ($RotateMe)

    ; Retrieves a handle of a display device context for the client area a window
    $hDC = _WinAPI_GetDC ($hGUI)

    ; Set text- and back color
    _WinAPI_SetTextColor ($hDC, $tcolor)
    _WinAPI_SetBkColor ($hDC, $bcolor)
    If $transparent Then _WinAPI_SetBkMode($hDC, $TRANSPARENT)

    ; Selects an object into the specified device context
    _WinAPI_SelectObject ($hdc, $rFont)

    ; Draws formatted text in the specified rectangle
    _WinAPI_DrawText ($hDC, $text, $tRect, $DT_NOCLIP + $DT_NOPREFIX)

    $tRect = 0
EndFunc

Example:

#include <GDIplus.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("[#] Form1 [#]", 633, 447, 192, 124)
$Label1 = GUICtrlCreateLabel("Autoit team", 40, 112, 57, 17)
$Progress1 = GUICtrlCreateProgress(104, 192, 177, 49, BitOR($PBS_SMOOTH,$PBS_VERTICAL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Display_Rotated_Text($Form1, "Autoit team", 40, 260, 90, 400, 24)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

Func Display_Rotated_Text($hGUI, $text, $px, $py, $angle = 90, $tw = 400, $th = 12, $tcolor = 0x000000, $bcolor = 0xF0F0F0, $font = 'Arial', $transparent = True)
    Local $tRect, $rotate, $RotateMe, $rFont, $hDC

    ; Create RECT-structure, fill data
    $tRect = DllStructCreate ($tagRECT)
    DllStructSetData ($tRect, 'Left', $px)
    DllStructSetData ($tRect, 'Top', $py)

    ; Set rotation
    $rotate = $angle * 10

    ; Create structure for rotate text, fill data
    $RotateMe = DllStructCreate ($tagLOGFONT)
    DllStructSetData ($RotateMe, 'Escapement', $rotate)
    DllStructSetData ($RotateMe, 'Weight', $tw)
    DllStructSetData ($RotateMe, 'Height', $th)
    DllStructSetData ($RotateMe, 'FaceName', $font)

    ; Creates a logical font that has specific characteristics
    $rFont = _WinAPI_CreateFontIndirect ($RotateMe)

    ; Retrieves a handle of a display device context for the client area a window
    $hDC = _WinAPI_GetDC ($hGUI)

    ; Set text- and back color
    _WinAPI_SetTextColor ($hDC, $tcolor)
    _WinAPI_SetBkColor ($hDC, $bcolor)
    If $transparent Then _WinAPI_SetBkMode($hDC, $TRANSPARENT)

    ; Selects an object into the specified device context
    _WinAPI_SelectObject ($hdc, $rFont)

    ; Draws formatted text in the specified rectangle
    _WinAPI_DrawText ($hDC, $text, $tRect, $DT_NOCLIP + $DT_NOPREFIX)

    $tRect = 0
EndFunc

Another example here -> Fussball Chronograph (German only!)

BR,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 2 years later...

Here a routine made by BugFix (I put it to a function):

;Thanks to BugFix
Func Display_Rotated_Text($hGUI, $text, $px, $py, $angle = 90, $tw = 400, $th = 12, $tcolor = 0x000000, $bcolor = 0xF0F0F0, $font = 'Arial', $transparent = True)
    Local $tRect, $rotate, $RotateMe, $rFont, $hDC

    ; Create RECT-structure, fill data
    $tRect = DllStructCreate ($tagRECT)
    DllStructSetData ($tRect, 'Left', $px)
    DllStructSetData ($tRect, 'Top', $py)

    ; Set rotation
    $rotate = $angle * 10

    ; Create structure for rotate text, fill data
    $RotateMe = DllStructCreate ($tagLOGFONT)
    DllStructSetData ($RotateMe, 'Escapement', $rotate)
    DllStructSetData ($RotateMe, 'Weight', $tw)
    DllStructSetData ($RotateMe, 'Height', $th)
    DllStructSetData ($RotateMe, 'FaceName', $font)

    ; Creates a logical font that has specific characteristics
    $rFont = _WinAPI_CreateFontIndirect ($RotateMe)

    ; Retrieves a handle of a display device context for the client area a window
    $hDC = _WinAPI_GetDC ($hGUI)

    ; Set text- and back color
    _WinAPI_SetTextColor ($hDC, $tcolor)
    _WinAPI_SetBkColor ($hDC, $bcolor)
    If $transparent Then _WinAPI_SetBkMode($hDC, $TRANSPARENT)

    ; Selects an object into the specified device context
    _WinAPI_SelectObject ($hdc, $rFont)

    ; Draws formatted text in the specified rectangle
    _WinAPI_DrawText ($hDC, $text, $tRect, $DT_NOCLIP + $DT_NOPREFIX)

    $tRect = 0
EndFunc

Example:

#include <GDIplus.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("[#] Form1 [#]", 633, 447, 192, 124)
$Label1 = GUICtrlCreateLabel("Autoit team", 40, 112, 57, 17)
$Progress1 = GUICtrlCreateProgress(104, 192, 177, 49, BitOR($PBS_SMOOTH,$PBS_VERTICAL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Display_Rotated_Text($Form1, "Autoit team", 40, 260, 90, 400, 24)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

Func Display_Rotated_Text($hGUI, $text, $px, $py, $angle = 90, $tw = 400, $th = 12, $tcolor = 0x000000, $bcolor = 0xF0F0F0, $font = 'Arial', $transparent = True)
    Local $tRect, $rotate, $RotateMe, $rFont, $hDC

    ; Create RECT-structure, fill data
    $tRect = DllStructCreate ($tagRECT)
    DllStructSetData ($tRect, 'Left', $px)
    DllStructSetData ($tRect, 'Top', $py)

    ; Set rotation
    $rotate = $angle * 10

    ; Create structure for rotate text, fill data
    $RotateMe = DllStructCreate ($tagLOGFONT)
    DllStructSetData ($RotateMe, 'Escapement', $rotate)
    DllStructSetData ($RotateMe, 'Weight', $tw)
    DllStructSetData ($RotateMe, 'Height', $th)
    DllStructSetData ($RotateMe, 'FaceName', $font)

    ; Creates a logical font that has specific characteristics
    $rFont = _WinAPI_CreateFontIndirect ($RotateMe)

    ; Retrieves a handle of a display device context for the client area a window
    $hDC = _WinAPI_GetDC ($hGUI)

    ; Set text- and back color
    _WinAPI_SetTextColor ($hDC, $tcolor)
    _WinAPI_SetBkColor ($hDC, $bcolor)
    If $transparent Then _WinAPI_SetBkMode($hDC, $TRANSPARENT)

    ; Selects an object into the specified device context
    _WinAPI_SelectObject ($hdc, $rFont)

    ; Draws formatted text in the specified rectangle
    _WinAPI_DrawText ($hDC, $text, $tRect, $DT_NOCLIP + $DT_NOPREFIX)

    $tRect = 0
EndFunc

Another example here -> Fussball Chronograph (German only!)

BR,

UEZ

and if you want to modify text later?
Link to comment
Share on other sites

Something like this here?

#include <GDIplus.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("[#] Form1 [#]", 633, 447, 192, 124, Default, $WS_EX_COMPOSITED)
$Label1 = GUICtrlCreateLabel("Autoit team", 40, 112, 57, 17)
$Progress1 = GUICtrlCreateProgress(104, 192, 177, 49, BitOR($PBS_SMOOTH, $PBS_VERTICAL))
GUICtrlSetData($Progress1, 50)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
Global $iBGColor = _WinAPI_GetSysColor($COLOR_3DFACE)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iBGColor = ' & Hex($iBGColor) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
Global $iCounter = 0

GUIRegisterMsg(0x000F, "WM_PAINT") ;$WM_PAINT = 0x000F
AdlibRegister("Counter", 250)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            AdlibUnRegister("Counter")
            GUIRegisterMsg(0x000F, "")
            Exit
    EndSwitch
WEnd

Func Counter()
    $iCounter += 1
    _WinAPI_RedrawWindow($Form1, 0, 0, $RDW_INVALIDATE + $RDW_UPDATENOW)
EndFunc   ;==>Counter

Func WM_PAINT()
    Display_Rotated_Text($Form1, "Autoit team " & $iCounter, 40, 300, 90, 400, 24, 0, $iBGColor)
    Return "GUI_RUNDEFMSG"
EndFunc   ;==>WM_PAINT

Func Display_Rotated_Text($hGUI, $text, $px, $py, $angle = 90, $tw = 400, $th = 12, $tcolor = 0x000000, $bcolor = 0xF0F0F0, $font = 'Arial', $transparent = False)
    Local $tRect, $rotate, $RotateMe, $rFont, $hDC

    ; Create RECT-structure, fill data
    $tRect = DllStructCreate($tagRECT)
    DllStructSetData($tRect, 'Left', $px)
    DllStructSetData($tRect, 'Top', $py)

    ; Set rotation
    $rotate = $angle * 10

    ; Create structure for rotate text, fill data
    $RotateMe = DllStructCreate($tagLOGFONT)
    DllStructSetData($RotateMe, 'Escapement', $rotate)
    DllStructSetData($RotateMe, 'Weight', $tw)
    DllStructSetData($RotateMe, 'Height', $th)
    DllStructSetData($RotateMe, 'FaceName', $font)
    DllStructSetData($RotateMe, 'Quality', 5)
    ; Creates a logical font that has specific characteristics
    $rFont = _WinAPI_CreateFontIndirect($RotateMe)

    ; Retrieves a handle of a display device context for the client area a window
    $hDC = _WinAPI_GetDC($hGUI)

    ; Set text- and back color
    _WinAPI_SetTextColor($hDC, $tcolor)
    _WinAPI_SetBkColor($hDC, $bcolor)
    If $transparent Then _WinAPI_SetBkMode($hDC, $transparent)

    ; Selects an object into the specified device context
    _WinAPI_SelectObject($hDC, $rFont)

    ; Draws formatted text in the specified rectangle
    _WinAPI_DrawText($hDC, $text, $tRect, $DT_NOCLIP + $DT_NOPREFIX)

    $tRect = 0
EndFunc   ;==>Display_Rotated_Text

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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