Jump to content

text maximized with window


Recommended Posts

  • Moderators

Ontosy,

This only works for changes in width, but it gives you the idea of how you might go about it: ;)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate("Test", 500, 500, -1, -1, BitOR($WS_SIZEBOX, $WS_SYSMENU, $WS_MINIMIZEBOX))

$hLabel = GUICtrlCreateLabel("", 0, 0, 200, 200)
GUICtrlSetData(-2, "This is a test of the text size increasing function")
GUICtrlSetBkColor(-1, 0x00FF00)
GUICtrlSetFont(-1, 20)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)

GUISetState()

GUIRegisterMsg($WM_SIZE, "_WM_SIZE")

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam)

    ; If it is our GUI
    If $hWnd = $hGUI Then
        ; Get the new size of the GUI
        $iGUIWidth = BitAND($lParam, 0xFFFF)
        $iGUIHeight = BitShift($lParam, 16)
        ; Determine ratio
        $nRatio = $iGUIWidth / 500
        ; Determine new font size
        $iFontSize = Round(20 * $nRatio)
        ; Alter label font size
        GUICtrlSetFont($hLabel, $iFontSize)

    EndIf

EndFunc   ;==>_WM_SIZE

Please let us see any developments that you make - particularly using both directions. :)

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 post
Share on other sites

ty, it work good :)

but now i have problem with:

GUICtrlCreateGraphic(8, 8, 272, 92, _

BitOR($SS_CENTER,$SS_RIGHT,$SS_BLACKRECT,$SS_GRAYRECT,$SS_WHITERECT, _

$SS_BLACKFRAME,$SS_NOTIFY,$SS_SUNKEN,$WS_GROUP))

GUICtrlSetResizing(-1, $GUI_DOCKAUTO)

Graphic not resize.

Link to post
Share on other sites
  • Moderators

Ontosy,

I do not think the contents of Graphic controls can be resized with GUICtrlSetResizing - the control itself resizes but not the contents. :)

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 post
Share on other sites
  • Moderators

Ontosy,

Then I suggest you simplify the style statement a bit - you have a number of mutually incompatible styles in there. I sugges tusing just one of each of these groups:

$SS_CENTER,$SS_RIGHT

$SS_BLACKRECT,$SS_GRAYRECT,$SS_WHITERECT

This script resizes the graphic control for me: ;)

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

$hGUI = GUICreate("Test", 500, 500, -1, -1, BitOR($WS_SIZEBOX, $WS_SYSMENU, $WS_MINIMIZEBOX))

$hGraphic = GUICtrlCreateGraphic(0, 0, 200, 200, BitOR($SS_CENTER, $SS_BLACKFRAME, $SS_NOTIFY, $SS_SUNKEN))

GUICtrlSetColor(-1, 0)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000, 0xff0000)
GUICtrlSetGraphic(-1, $GUI_GR_PIE, 50, 50, 40, 30, 270)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xffffff)
GUICtrlSetGraphic(-1, $GUI_GR_PIE, 58, 50, 40, -60, 90)

GUICtrlSetResizing(-1, $GUI_DOCKAUTO)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Does it for you? :)

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 post
Share on other sites
  • Moderators

Ontosy,

I think not, but someone else might know differently. :)

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 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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...