Jump to content

Best practice to make as standard gui as possible


Fenzik
 Share

Recommended Posts

Hello all,

i tryed searching the forum, but i still don't have answer to this question.

I'm a bit lost in Common Gui Styles.

As blind developer, i'm not sure how the styles look in result.

So, what's the best combination to make as standard window as possible?

From help file, i found folowing style combination as good enough and most universal for my projects. But is this enough? :) Or i should add some style?

I'm using this for Main Gui Windows with menu, and also for other windows without Main menu (Program Settings, etc.).

GUICreate("Main Gui", 800, 600, "", "", BitOR($WS_MAXIMIZE, $WS_OVERLAPPEDWINDOW))

Thank you for your replyes.

Link to comment
Share on other sites

Hi, in my opinion you should mess with the common styles only when you have a special need to create a window in a specific way.

When you don't have any particular need for a window, you can leave the style alone, and use default/blank.

You ask how to create a standard window.. all you really have to do is remove the part on your line past the 600, the Y coordinate, close braket there and leave it.

This:

GUICreate("Main Gui", 800, 600)

PS: your software is replacing the letter i with the y in the words "tried" and "replies", just thought you might want to know.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Thank you careca.

Ok, i'll do it like you recomended.

I thought, that styles are required, for example when you want to use Main menu control in the window.

And thank you, i¨ll check my software for unpredictable I and Y changes... :)

Link to comment
Share on other sites

44 minutes ago, Fenzik said:

I thought, that styles are required

If you dont specify any style, the default styles are applied, as per help file:

use -1 for the default style which includes a combination of $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU
Link to comment
Share on other sites

Thank you dmob...

Yes, this is in the Help.

And in the same topic is also:

By default the dialog box is non sizable and non maximizable. So WS_SIZEBOX or WS_MAXIMIZEBOX can be used in the style parameter.
As defining only one style just set this style don't forget to combine it with default ones, i.e. just defining WS_SIZEBOX will not set $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU. So the best method to define a resizeable window is to use $WS_OVERLAPPEDWINDOW.

 

This is reason, why i'm little bit lost in styles at all and whi i was using WS_OVERLAPPEDWINDOW before. :)

 

But without any style everithing looks working. So thank you again.

Link to comment
Share on other sites

AFAIK, the WS_OVERLAPPEDWINDOW is normally used to enable through controls in a child window; I might be wrong though.

I use this little function to make it easier to add or remove styles; requires some includes.

Func _GUICtrlSetStyle($hCtrl, $iStyle, $bSet = True)
    ; Read the current style
    Local $iCurr = _WinAPI_GetWindowLong(GUICtrlGetHandle($hCtrl), $GWL_STYLE)
    If $bSet Then
        ; ADD style
        GUICtrlSetStyle($hCtrl, BitOr($iCurr, $iStyle))
    Else
        ; REMOVE style
        GUICtrlSetStyle($hCtrl, BitXOR($iCurr, $iStyle))
    EndIf
EndFunc   ;==>_GUICtrlSetStyle

 

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