Jump to content

Automaticly Resize every thing in a gui to fit monitors


GNGNUT
 Share

Recommended Posts

#region ### START Koda GUI section ### Form=
$ROBOT_WALLBOARD = GUICreate("ROBOT WALLBOARD", 1902, 924, 6, 2,$WS_SIZEBOX + $WS_SYSMENU)
GUISetBkColor(0xC0C0C0)
GUISetFont(8, -1, "Arial")

$lTime = GUICtrlCreateLabel("Time1", 72, 800, 1048, 116, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_SUNKEN))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")  ;;   TIMER
;;**********************  Robbie  *******************************
$Robbie = GUICtrlCreateGroup("Robbie", 0, 3, 409, 625)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$VUnactioned = GUICtrlCreateLabel("UNACTIONED", 112, 115, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_SUNKEN))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP)

$VAXANEWCLAIM = GUICtrlCreateLabel("axapliclaims", 115, 461, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_SUNKEN))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP)

$lAXA_NEW_CLIAM = GUICtrlCreateLabel("AXA New Claims", 64, 355, 283, 65, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 35, 400, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP)

$lUNACTION = GUICtrlCreateLabel("Unaction Web Claims", 8, 35, 394, 50, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 35, 400, 0, "MS Sans Serif")
;;;*********   TIMERS   ********
$Label1 = GUICtrlCreateLabel("UWC_timer", 120, 233, 170, 41, BitOR($SS_CENTER,$SS_CENTERIMAGE))  ;;;  unaction timer
GUICtrlSetFont(-1, 50, 400, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("AXA_timer", 136, 573, 128, 36, BitOR($SS_CENTER,$SS_CENTERIMAGE))   ;;;  AXA timer
GUICtrlSetFont(-1, 50, 400, 0, "MS Sans Serif")
GUICtrlCreateGroup("", -99, -99, 1, 1)
;;**********************  Ricky  *******************************
$Ricky = GUICtrlCreateGroup("Ricky", 416, 3, 785, 625)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$VPayment = GUICtrlCreateLabel("Payments", 510, 461, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_SUNKEN))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")
$vAUDA = GUICtrlCreateLabel("AUDA", 510, 115, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_SUNKEN))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")
$VSims = GUICtrlCreateLabel("FVSIMSWEB", 911, 461, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_SUNKEN))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")
$VAXAPLI = GUICtrlCreateLabel("AXAPLI", 912, 115, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_SUNKEN))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")
$lAuda = GUICtrlCreateLabel("Auda", 544, 27, 117, 57, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 35, 400, 0, "MS Sans Serif")
$LPaymentemail = GUICtrlCreateLabel("Payment Emails", 448, 355, 302, 65, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 35, 400, 0, "MS Sans Serif")
$LSimsweb = GUICtrlCreateLabel("SIMS Web Service", 867, 355, 265, 65, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 35, 400, 0, "MS Sans Serif")
$LAXAPLI = GUICtrlCreateLabel("AXA PLI Assessments", 840, 35, 320, 49, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 35, 400, 0, "MS Sans Serif")
$Label3 = GUICtrlCreateLabel("AuD_timer", 528, 233, 156, 41,BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 50, 400, 0, "MS Sans Serif")
$Label4 = GUICtrlCreateLabel("PLI_timer", 936, 233, 140, 41,BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 50, 400, 0, "MS Sans Serif")
$Label6 = GUICtrlCreateLabel("PAY_timer", 536, 573, 130, 36,BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 50, 400, 0, "MS Sans Serif")
$Label7 = GUICtrlCreateLabel("WEB_timer", 936, 573, 138, 36,BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 50, 400, 0, "MS Sans Serif")
GUICtrlCreateGroup("", -99, -99, 1, 1)
;;**********************  Ralph  *******************************
$RALPH = GUICtrlCreateGroup("RALPH", 1224, 8, 314, 196)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$AXAPLI_INSTRUCTION = GUICtrlCreateLabel("AXA PLI Instruction", 1232, 40, 296, 49, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 35, 400, 0, "MS Sans Serif")
$AXAPLI_INST = GUICtrlCreateLabel("AXAPLI_INST_", 1256, 112, 255, 65, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_SUNKEN))
GUICtrlSetFont(-1, 50, 400, 0, "Arial")
GUICtrlCreateGroup("", -99, -99, 1, 1)
;;********************** Crif  *******************************
$CRIF = GUICtrlCreateGroup("CRIF", 1224, 244, 314, 188)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$CRIF_VALUE = GUICtrlCreateLabel("CRIF_VALUE", 1256, 340, 255, 65, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_SUNKEN))
GUICtrlSetFont(-1, 50, 400, 0, "Arial")
$CRIF_MOJ = GUICtrlCreateLabel("CRIF MOJ Download", 1232, 268, 300, 49, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 33, 400, 0, "MS Sans Serif")
GUICtrlCreateGroup("", -99, -99, 1, 1)
;;**********************  Phoenix  *******************************
$PHOENIX = GUICtrlCreateGroup("Phoenix", 1568, 244, 314, 188)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$FPHOENIX = GUICtrlCreateLabel("Phoenix Robot", 1576, 268, 290, 49, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 35, 400, 0, "MS Sans Serif")
$PHONIX_VALUE = GUICtrlCreateLabel("PHONIX_VALUE", 1600, 340, 255, 65, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_SUNKEN))
GUICtrlSetFont(-1, 50, 400, 0, "Arial")
GUICtrlCreateGroup("", -99, -99, 1, 1)


;;**********************  rufus  *******************************
$RUFUS = GUICtrlCreateGroup("RUFUS", 1568, 8, 314, 196)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Rufus Processing", 1576, 40, 295, 49, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 35, 400, 0, "MS Sans Serif")
$RUFUS_VALUE = GUICtrlCreateLabel("RUFUS_VALUE", 1598, 112, 255, 65, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_SUNKEN))
GUICtrlSetFont(-1, 50, 400, 0, "Arial")
GUICtrlCreateGroup("", -99, -99, 1, 1)

$LMU = GUICtrlCreateLabel("Motor Users", 56, 628, 178, 41, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
$VMU = GUICtrlCreateLabel("ML", 55, 675, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")

$LSU = GUICtrlCreateLabel("Safaris users", 272, 628, 191, 41, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
$VSU = GUICtrlCreateLabel("SL", 278, 675, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")

$LKU = GUICtrlCreateLabel("Knight Users", 496, 628, 187, 41, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
$VKU = GUICtrlCreateLabel("KL", 500, 675, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")

$LTU = GUICtrlCreateLabel("Travel Users", 720, 628, 184, 41, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
$VTU = GUICtrlCreateLabel("TL", 723, 675, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")

$LRU = GUICtrlCreateLabel("Rehab Users", 944, 628, 189, 41, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
$VRU = GUICtrlCreateLabel("RL", 950, 675, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")

$LGrandtotal = GUICtrlCreateLabel("Total", 1215, 628, 109, 41, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
$VGrandtotal  = GUICtrlCreateLabel("Label2", 1180, 675, 180, 80, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 75, 400, 0, "MS Sans Serif")



;;**********************  Hard Drvies  *******************************

$Group1 = GUICtrlCreateGroup("Hard Drive Status", 1222, 464, 660, 161)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$LMotor = GUICtrlCreateLabel("Motor", 1224, 504, 202, 36, $SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")
$LTravel = GUICtrlCreateLabel("Trav / Saf", 1224, 536, 202, 36, $SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")
$LELM = GUICtrlCreateLabel("Elmbridge", 1224, 568, 202, 36, $SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")
$LCURRENT = GUICtrlCreateLabel("Current", 1458, 475, 66, 28,$SS_CENTER)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
$LSTART = GUICtrlCreateLabel("Started With", 1610, 475, 104, 28,$SS_CENTER)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
$LUSED = GUICtrlCreateLabel("Used", 1785, 475, 48, 28,$SS_CENTER)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")

;; #####  Current fields #####
$Vmotor = GUICtrlCreateLabel("", 1420, 504, 150, 36, $SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")
$VTravel = GUICtrlCreateLabel("", 1420, 536, 150, 36, $SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")
$VELM = GUICtrlCreateLabel("", 1420, 568, 150, 36, $SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")

;; #####  Start with Totals #####
$vMotor1 = GUICtrlCreateLabel("$vMotor1", 1590, 504, 150, 36, $SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")
$vTravel1 = GUICtrlCreateLabel("$vTravle1", 1590, 536, 150, 36, $SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")
$vELM1 = GUICtrlCreateLabel("$vELM1", 1590, 568, 150, 36, $SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")

;; #####  USED #####

$LUSEDM = GUICtrlCreateLabel("Mused", 1760, 504, 100, 36,$SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor($LUSEDM,0x00FF00)
$LUSEDT = GUICtrlCreateLabel("Tused", 1760, 536, 100, 36,$SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor($LUSEDT,0x00FF00)
$LUSEDE = GUICtrlCreateLabel("Eused", 1760, 568, 100, 36,$SS_CENTER)
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor($LUSEDE,0x00FF00)
GUICtrlCreateGroup("", -99, -99, 1, 1)


GUISetState(@SW_SHOW)

        AdlibRegister("fWebclaims", 999)  ;; Correct
        AdlibRegister("fNEWAXAPLI", 999)  ;; Correct
        AdlibRegister("fauda", 999)       ;;Correct
        AdlibRegister("fAXAPLIASSESSMENTS", 999)  ;; correct
        AdlibRegister("fPayment", 999)  ;; correct
        AdlibRegister("fSWEB", 999)

        AdlibRegister("CRIFTIMER", 999)
        AdlibRegister("RALPHTIMER", 999)
        AdlibRegister("RUFUSTIMER", 999)
        AdlibRegister("PHONEIXTIMER", 999)
        AdlibRegister("time",999)

;~      populate borad on start up
;~      UserNumbers()
        Hardrives()   ; reading the hard drives
        $MotorSpacetotalstart  = $MotorSpacetotal
        $travelspaceTotalstart = $travelspaceTotal
        $ELMspaceTotalstart = $ELMspaceTotal
        $m1 =GUICtrlSetData($Vmotor1, $MotorSpacetotalstart&" GB")
        GUICtrlSetBkColor($Vmotor1, $Motorcolourgreen)
        $t1 =GUICtrlSetData($VTravel1, $travelspaceTotalstart&" GB")
        GUICtrlSetBkColor($VTravel1, $Motorcolourgreen)
        $e1 = GUICtrlSetData($VELM1, $ELMspaceTotalstart&" GB")
        GUICtrlSetBkColor($VELM1, $Motorcolourgreen)
        $flagHArddrive = 1
        $flagSTARTSPACE = 1

While 1
        $nMsg = GUIGetMsg()

        ;$vState = GUICtrlRead($Input1)
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
;~
$min=0
$sec=0
$min=@MIN
$sec=@sec

if $min=05 then
    if $sec=00 then
;~      UserNumbers()
        Hardrives()  ; reading the hard drives
        Harddisk()   ; Writing Data about hard drives
        Startwith()
        useddata()
    EndIf
 endif
if $min=20 Then
    if $sec=00 then
;~      UserNumbers()
        Hardrives()
        useddata()
    EndIf
endif
if $min=35 Then
    if $sec=00 then
;~      UserNumbers()
        Hardrives()
        useddata()
    EndIf
endif
if $min=50 Then
    if $sec=00 then
;~      UserNumbers()
        Hardrives()
        useddata()
    EndIf
endif
     ;;; < < Time span of when file is created every 15 mins

    WEnd
EndFunc   ;==>fTable

Hi guys

 

wonder if you can help

 

I have write this gui which was designed to fit on a 1910 x 1024  (wallboard) but after a office move around we have been reduce to a wall board that cant handle this size

 

Is there a simple bit of coding I can use in order to resize every thing ?

I am still a novice with this softwear and have had some help from others in order to create this,

Link to comment
Share on other sites

Yes.

It's usually convenient to put more controls which you may have to alter in an array, so you can modify them more easily.

Global $Array[5]

$Array[0] = GuiCtrlCreateButton("Button1", ...
$Array[1] = GuiCtrlCreateButton("Button2", ...
$Array[2] = GuiCtrlCreateButton("Button3", ...
$Array[3] = GuiCtrlCreateButton("Button4", ...
$Array[4] = GuiCtrlCreateButton("Button5", ...

Then you can do:

For $i = 0 To UBound($Array) - 1
    GuiCtrlSetState($Array[$i], ......
    ;or whatever
Next
Edited by Radiance
Link to comment
Share on other sites

Unfortunately you will have to revisit your code and make the change to all the controls. If anything you can look at this as a way to make your code cleaner and also add enhancements that you may want to do.

I'm also seeing you repeating certain items over and over. You may want to put items like that in a function. When you do that you can shorten your code and make it much easier to make changes when needed.

Link to comment
Share on other sites

  • Moderators

GNGNUT,

 

but will this mean I will have to add to each lable, field, group box ?

Not necessarily. You could try using Opt("GUIResizeMode", $GUI_DOCKAUTO) as that affects all controls within the GUI. it rather depends on how the controls are positioned as to whether that will work for all controls as sometimes you need to be more specific about certain ones. But it is worth a try. :)

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

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