Jump to content

MetroGUI UDF v5.1 - Windows 10 style buttons, toggles, radios, menu etc.


BBs19
 Share

Recommended Posts

  • 2 months later...

is there any way to make GetCurrentGUI() not to flick gui ? 

(it's difficult to give you an example code right now) 

when i use the _metro_enablebutton it instantly redraws gui (i tried sw lock with no success) 

the only solution that i found is to give directly the gui parameter to enablebutton func

 

edit -> am not sure (because i must remove the previous "fix", but if i change the (from getcurrentgui func)

Local $idCtrlDummy = GUICtrlCreateLabel("", 0, 0, 0, 0)

to 

Local $idCtrlDummy = GUICtrlCreateLabel("", 0, 0, 1, 1)

 

it seems ok

Edited by radienergos
Link to comment
Share on other sites

  • 2 weeks later...

Any help is appreciated?

 

-#############################################################################################

-#### Au3Stripper Found   5 Error(s)!!!!    This means your script could have problems running properly.  ####
-#############################################################################################
- 2.50 Iteration 1 Strip and Rename Functions result: Output  5321 lines and stripped 7253 lines
- 5.38 Iteration 2 Strip Variables result: Output  3013 lines and stripped 2308 lines
- 6.00 Iteration 3 Strip Variables result: Output  2926 lines and stripped 87 lines
- 6.63 Iteration 4 Strip Variables result: Output  2923 lines and stripped 3 lines
- 7.25 Iteration 5 Strip and Rename Variables result: Output  2923 lines and stripped 0 lines
+> Source    22107 lines 1083820 Characters.
+> Stripped  9651 Func/Var lines and  9210 comment lines, Total 998836 Characters.
+> Saved     85% lines 92% Characters.
+> 0 Au3Stripper v15.920.938.0 finished created:C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3
+>11:12:39 Au3Stripper ended.rc:0
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3
"C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3"(1028,26) : warning: $5g: possibly used before declaration.
For $5f = 0 To UBound($5g)
~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3"(1067,54) : error: INTERNAL_INTERCEPT_FRAMEDRAW(): undefined function.
GUIRegisterMsg(0x0083, "INTERNAL_INTERCEPT_FRAMEDRAW")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3 - 1 error(s), 1 warning(s)
!>11:12:39 AU3Check ended. Press F4 to jump to next error.rc:2
+>11:12:39 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 9.544

 

Link to comment
Share on other sites

On 4.1.2017 at 11:37 AM, radienergos said:

is there any way to make GetCurrentGUI() not to flick gui ? 

(it's difficult to give you an example code right now) 

when i use the _metro_enablebutton it instantly redraws gui (i tried sw lock with no success) 

the only solution that i found is to give directly the gui parameter to enablebutton func

 

edit -> am not sure (because i must remove the previous "fix", but if i change the (from getcurrentgui func)

Local $idCtrlDummy = GUICtrlCreateLabel("", 0, 0, 0, 0)

to 

Local $idCtrlDummy = GUICtrlCreateLabel("", 0, 0, 1, 1)

 

it seems ok

Hmm not sure what you mean. I can't see any flickering. Can you post an example?

 

On 17.1.2017 at 11:16 AM, RyukShini said:

Any help is appreciated?

 

-#############################################################################################

-#### Au3Stripper Found   5 Error(s)!!!!    This means your script could have problems running properly.  ####
-#############################################################################################
- 2.50 Iteration 1 Strip and Rename Functions result: Output  5321 lines and stripped 7253 lines
- 5.38 Iteration 2 Strip Variables result: Output  3013 lines and stripped 2308 lines
- 6.00 Iteration 3 Strip Variables result: Output  2926 lines and stripped 87 lines
- 6.63 Iteration 4 Strip Variables result: Output  2923 lines and stripped 3 lines
- 7.25 Iteration 5 Strip and Rename Variables result: Output  2923 lines and stripped 0 lines
+> Source    22107 lines 1083820 Characters.
+> Stripped  9651 Func/Var lines and  9210 comment lines, Total 998836 Characters.
+> Saved     85% lines 92% Characters.
+> 0 Au3Stripper v15.920.938.0 finished created:C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3
+>11:12:39 Au3Stripper ended.rc:0
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3
"C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3"(1028,26) : warning: $5g: possibly used before declaration.
For $5f = 0 To UBound($5g)
~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3"(1067,54) : error: INTERNAL_INTERCEPT_FRAMEDRAW(): undefined function.
GUIRegisterMsg(0x0083, "INTERNAL_INTERCEPT_FRAMEDRAW")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3 - 1 error(s), 1 warning(s)
!>11:12:39 AU3Check ended. Press F4 to jump to next error.rc:2
+>11:12:39 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 9.544

 

Try installing the newest version of Autoit and the Scite Editor. The Au3Stripper seems outdated. I have (16.306.1237.0) running and it doesn't return any errors.

Link to comment
Share on other sites

  • 2 weeks later...

Hi everyone,

I have a problem displaying this GUI on different systems. On my laptop (windows 7) it looks like this:

:good.PNG

However, when displayed on my friends laptop (windows 10) the controls are not properly aligned and don't even fit on the screen. Here's a screenshot:

bad.PNG

 

I have no idea how to fix this. Anybody have some advice?

My script:

ExcelTools_V1.au3

Link to comment
Share on other sites

Are you sure, you used exactly the same script?

 

When I look at this for example:

$b = 66 + $t        ; Begin pos Toggles
$b1 = 105 + $t      ; Begin pos Inputs

...

Global $Checkbox2 = _Metro_CreateToggle("To UPPERCASE", $l + 40, $b, 180, 30)
    Global $Hotbut2 = _GUICtrlCreateInput("", $l + 320, $b1, 30, 25, $SS_CENTER)

I don't understand why the controls should have the same Top position under Win7..

Link to comment
Share on other sites

Yes, it's exactly the same script. That little bit of code is just to make it easier for me to slide all controls down with a certain amount of pixels.

Does it display well at your side?

 

Edited by ludocus
Link to comment
Share on other sites

@ludocus

I use Win 10 and it looked as bad as your Win 10 screenshot. But.. Do I miss something?  In the example that I looked at., the Inputfield next to the toggle UPPERCASE should have the same (or nearly the same) Top position. But $b1 is always 39 bigger then $b, what the variables for your Top position is. So the positions I can see with Win 10 seem for me exactly that, what your code says... I don't understand it.

Edited by nobbitry
Link to comment
Share on other sites

@nobbitry

You are absolutely right and I now this is confusing. I had to enter different heights because they were displayed at different heights if I entered the same height for both (still following me? :p).

@KarlosTHG

Well if that's the problem, then that solution won't work for me as this program will be installed on a lot of different systems. It should just work for everyone without having to change any settings in windows. So I might just add an If statement that will change the GUI when it is displayed on windows 10 versus windows 7.

Thank you both!

Link to comment
Share on other sites

6 hours ago, ludocus said:

@nobbitry

You are absolutely right and I now this is confusing. I had to enter different heights because they were displayed at different heights if I entered the same height for both (still following me? :p).

@KarlosTHG

Well if that's the problem, then that solution won't work for me as this program will be installed on a lot of different systems. It should just work for everyone without having to change any settings in windows. So I might just add an If statement that will change the GUI when it is displayed on windows 10 versus windows 7.

Thank you both!

Did you tried changing:

;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling())
;#AutoIt3Wrapper_Res_HiDpi=Y

to:

;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling())
#AutoIt3Wrapper_Res_HiDpi=Y


maybe that can help

Link to comment
Share on other sites

I managed to fix it by adding custom positions when operating system is windows 10.

Btw, when I try to compile the script, I get a message saying "Incorrect Wrapper Directive '#Autoit3Wrapper_REs_HiDpi=Y' "

Am I compiling it wrong or something?

 

Link to comment
Share on other sites

On 31.1.2017 at 9:56 AM, ludocus said:

Hi everyone,

I have a problem displaying this GUI on different systems. On my laptop (windows 7) it looks like this:

:good.PNG

However, when displayed on my friends laptop (windows 10) the controls are not properly aligned and don't even fit on the screen. Here's a screenshot:

bad.PNG

 

I have no idea how to fix this. Anybody have some advice?

My script:

ExcelTools_V1.au3

 

Hi,

This UDF is already optimized for high resolution screens, meaning all buttons, toggles and even the main GUI will be created with a dynamic size so that everything looks very sharp no matter that DPI size the user is using. Unfortunately many modern programs lack this feature which causes them to look very small, blurred or the controls are completely out of size and position on 4k Displays which mostly require higher DPI sizes. That why I had to add this feature.

If you use _Metro_EnableHighDPIScaling() and #AutoIt3Wrapper_Res_HiDpi=Y, then this feature will be enabled and you will require to calculate the pos+size of all controls that are created using Autoits GUICtrlCreate... functions. All functions like _Metro_CreateButton already do this by default, so no need to change anything for them.

It is actually pretty easy but might take some time if you have many controls. There is already a global variable declared in the UDF, that can be used to calculate the position/size. You can use ( x * $gDPI) for every position and size parameter.

Global $titlelabel = GUICtrlCreateLabel ("ExcelTools", 80*$gdpi, 6*$gdpi, 200*$gdpi, 28*$gdpi)

While creating the GUI, you should disable _Metro_EnableHighDPIScaling() and #AutoIt3Wrapper_Res_HiDpi=Y and create your GUI like you would usually do. After that you can enable them again and add *$gDPI to all the Autoit GUICtrlCreate... functions. This way your program will look the same on all computers when it is compiled.

 

On 2.2.2017 at 5:12 PM, ludocus said:

I managed to fix it by adding custom positions when operating system is windows 10.

Btw, when I try to compile the script, I get a message saying "Incorrect Wrapper Directive '#Autoit3Wrapper_REs_HiDpi=Y' "

Am I compiling it wrong or something?

 

Check if you have the latest Autoit and Scite Tools version installed. It should work like provided in the example GUI.

Edited by BBs19
Link to comment
Share on other sites

@BBs19: I've read up on the DPI issues and tried a few tests ... but uncertainties creep back in.  Since you seem well-versed in DPI, can you clarify you last statement:

Quote

While creating the GUI, you should disable _Metro_EnableHighDPIScaling() and #AutoIt3Wrapper_Res_HiDpi=Y and create your GUI like you would usually do.

If I apply the multipliers to the X, Y positions of all my GUI elements, which way should the Wrapper setting be? ... Y or N?

And if I decide not to use multipliers (and just let the OS scale everything in the blurry manner), what is the proper Wrapper setting?

I hope you don't mind responding to this.  From the AutoIt standpoint, it appears that your MetroGUI UDF is leading the way in this "frontier" of technology.

 

 

Link to comment
Share on other sites

5 hours ago, qwert said:

@BBs19: I've read up on the DPI issues and tried a few tests ... but uncertainties creep back in.  Since you seem well-versed in DPI, can you clarify you last statement:

If I apply the multipliers to the X, Y positions of all my GUI elements, which way should the Wrapper setting be? ... Y or N?

And if I decide not to use multipliers (and just let the OS scale everything in the blurry manner), what is the proper Wrapper setting?

I hope you don't mind responding to this.  From the AutoIt standpoint, it appears that your MetroGUI UDF is leading the way in this "frontier" of technology.

If you apply the multipliers, then you have to set #AutoIt3Wrapper_Res_HiDpi to "Y" and add _Metro_EnableHighDPIScaling()  to the script so that Windows doesn't try to rescale the program as you would be doing that yourself.

If you want to let Windows scale everything, then you just remove _Metro_EnableHighDPIScaling()  and #AutoIt3Wrapper_Res_HiDpi=Y (or put it to N) from your code.

Link to comment
Share on other sites

  • 2 weeks later...
On 5/8/2014 at 11:04 AM, BBs19 said:

Love what you did with this Metro UDF! I'm seeing a lot of ways to improve my code.

Are you able to include GUICtrlSetResizing for labels?

I would be interested too in working some transparency levels into the interface as well on Windows 7 machines and above?

Also, this tvshowcountdown app is amazing!  Would love to learn from the code behind this, if possible? If not, it's okay. Figure I'd ask anyway.

Thank you for all of your work!

(and U2 UEZ!)

Edited by coffeeturtle
Link to comment
Share on other sites

13 hours ago, coffeeturtle said:

Love what you did with this Metro UDF! I'm seeing a lot of ways to improve my code.

Are you able to include GUICtrlSetResizing for labels?

I would be interested too in working some transparency levels into the interface as well on Windows 7 machines and above?

Also, this tvshowcountdown app is amazing!  Would love to learn from the code behind this, if possible? If not, it's okay. Figure I'd ask anyway.

Thank you for all of your work!

(and U2 UEZ!)

Thanks :)

What do you mean with include GUICtrlSetResizing for labels?

TV-Show-Manager is opensource, so you can check out the code any time. But I would suggest you wait, as the code was written very bad back then, I am rewriting the program from scratch to look similar to Netflix. Here is a small demo: Picture It will take some time to finish, as I am not really motivated to work on it at the moment :) 

 

Link to comment
Share on other sites

13 hours ago, BBs19 said:

Thanks :)

What do you mean with include GUICtrlSetResizing for labels?

TV-Show-Manager is opensource, so you can check out the code any time. But I would suggest you wait, as the code was written very bad back then, I am rewriting the program from scratch to look similar to Netflix. Here is a small demo: Picture It will take some time to finish, as I am not really motivated to work on it at the moment :) 
 

Your Netflix-like program looks great so far! Nicely done!

And badly written or not, TVShowManager is not only good looking, not only have key functions that could easily be implemented in other functions, but it itself is very useful for keeping track of shows! (So many shows barely last one season so I like to keep track of some to see if they survive the cut and if I should binge watch or not). And I huge TV Show list is like having the TV Guide. Beautiful!

I'll look for the source code!

Now, I noticed that with your controls they automatically change to the right positions whether the window is normal size or maximized (like the OK button). Beautiful. So I was putting labels in the gui, but they didn't move where I wanted them. I thought it was because of not having GUICtrlSetResizing (or creating) functions for Metro styled labels. Of course, I could have done something wrong myself.

How far were you planning on taking the Metro Design? Tray Menu's? Calendar gui?  Just was wondering.

 

Thank you for everything you did so far.

Link to comment
Share on other sites

10 hours ago, coffeeturtle said:

Your Netflix-like program looks great so far! Nicely done!

And badly written or not, TVShowManager is not only good looking, not only have key functions that could easily be implemented in other functions, but it itself is very useful for keeping track of shows! (So many shows barely last one season so I like to keep track of some to see if they survive the cut and if I should binge watch or not). And I huge TV Show list is like having the TV Guide. Beautiful!

I'll look for the source code!

Now, I noticed that with your controls they automatically change to the right positions whether the window is normal size or maximized (like the OK button). Beautiful. So I was putting labels in the gui, but they didn't move where I wanted them. I thought it was because of not having GUICtrlSetResizing (or creating) functions for Metro styled labels. Of course, I could have done something wrong myself.

How far were you planning on taking the Metro Design? Tray Menu's? Calendar gui?  Just was wondering.

 

Thank you for everything you did so far.

If you set GUICtrlSetResizing correctly, then the label should also move in the position you want.

Well there are a lot of requests at the moment like Scrollbars,Sliders etc. and I don't know which will work or not. Everything that goes beyond simple clicking like buttons, checkboxes etc. require a lot of workarounds in the background which in return create problems with big projects.. 

There will be new features, but I don't know when I will have the time to work on it again.

Link to comment
Share on other sites

On 2/19/2017 at 4:50 AM, BBs19 said:

If you set GUICtrlSetResizing correctly, then the label should also move in the position you want.

Well there are a lot of requests at the moment like Scrollbars,Sliders etc. and I don't know which will work or not. Everything that goes beyond simple clicking like buttons, checkboxes etc. require a lot of workarounds in the background which in return create problems with big projects.. 

There will be new features, but I don't know when I will have the time to work on it again.

Understood. No worries. Everything seems to be working well.

Just was curious: What would be the best way to get Transparency to work with the Metro GUI?

On Windows 10, this works fine: _WinAPI_DwmEnableBlurBehindWindow10($Form1, True)/#include <_WinAPI_DwmEnableBlurBehindWindow10.au3>

However, this does not work with Windows 7. The old GUI Create does have a flag for transparent layers, but not sure if there is a Metro equivalent?

Thanks again!

Edited by coffeeturtle
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

×
×
  • Create New...