Jump to content

SciTe Question: Can the Main Program be collapsed?


Recommended Posts

  • Developers

Basically just that -- I ahve a GUI that is about 400 lines to setup, so I would like to condense it like you can with loops and functions.

is there a way to do this?

As in "View/Toggle all folds" ?

:D

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Refactor and structure your code!

Use regions. :D

#region - Global declarations
Global $guiMain, $ctlInput, $ctlLable
#endregion - Global declarations
; Include stuff
Main()
Exit
Func Main()
While 1
    $msg = GuiGetMsg()
    If $msg = 0 Then 
        Sleep(250)
    Else
        GuiMsgCracker($msg)
    EndIf
WEnd 
EndFunc 
Func GuiMsgCracker($msg)
    Switch $msg                   ;Switch requieres beta
            ;;;Do your stuff
        Case Else
    EndSwitch 
EndFunc

EDIT: Also remember CTRL+ALT+ LEFT_CLICK on a +/- in the sidebar of the code will fold all subfolds. CTRL+SHIFT+LEFT_CLICK does something else.

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