Jump to content

Recommended Posts

Posted

Hello guys...

I was wondering is this AutoIt bug or what?

When resize/move controls (labels, edits, buttons...) they are a little blinking... why?

Here is a little example, just run it and resize GUI, you will see about what I talking to:

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

$Form1 = GUICreate("Form1", 634, 450, 192, 124, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
GUISetBkColor(0x000000)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 617, 433)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM)
GUISetState(@SW_SHOW)

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

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted

This is one solution

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global Const $WS_EX_COMPOSITED = 0x2000000
$Form1 = GUICreate("Form1", 634, 450, 192, 124, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS),$WS_EX_COMPOSITED)
GUISetBkColor(0x000000)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 617, 433)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted (edited)

WOW!!! This is great man! :)

Edit: Oh no... minimize,maximize and exit buttons in window are bugged?! Why?!

Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted

WOW!!! This is great man! :)

Edit: Oh no... minimize,maximize and exit buttons in window are bugged?! Why?!

"bugged" ??

I don't find any problem.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted

Like martin, I don't see any problem... However simply dragging the mouse over the input box or whatever it is causes the mouse to flicker between being two different types of cursors.

I don't see that either, the cursor looks fine to me and doesn't change when I move it around the edit, or select some text by dragging.

Using 3.3.0.0

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted (edited)

They don't "repaint". That is, when you click-hold using the left mouse button, you won't see any visual feedback. The buttons still work, but it's just a visual feedback thing. If you use non Windows Classic themes too, the mouse hover effects on the buttons don't show.

(Aside: Besides the aforementioned bug, from my limited testing, WS_EX_COMPOSITED doesn't seem to work well with anything but simple UIs. If you throw in tabs, for example, controls in the tabs start not being painted correctly)

Edited by -Ultima-

[ WinINet.au3 | Array.au3 (Optimized) | _UnixTimeParse() ]

Posted (edited)

This is bug:

When I put mouse over minimize/maximize/exit button, there is no change... I don't know how to explain, I'm bad with English, and I'm made one picture explanation...

Posted Image

Posted Image

Do you have this bug?! I tested it on SP2 and SP3, and bug is there...

They don't "repaint". That is, when you click-hold using the left mouse button, you won't see any visual feedback. The buttons still work, but it's just a visual feedback thing. If you use non Windows Classic themes too, the mouse hover effects on the buttons don't show.

Yes, right that... Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted

Me neither. Ichigo, do you see bug about I talking? ;p

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted (edited)

Hello guys...

I was wondering is this AutoIt bug or what?

When resize/move controls (labels, edits, buttons...) they are a little blinking... why?

Here is a little example, just run it and resize GUI, you will see about what I talking to:

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

$Form1 = GUICreate("Form1", 634, 450, 192, 124, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
GUISetBkColor(0x000000)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 617, 433)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
If you add $GUI_CLIPCHILDREN $WS_CLIPCHILDREN (what rasim said) to your styles, that fixes the worst of it. Edited by ResNullius
Posted (edited)

n3nE

Add a $WS_CLIPCHILDREN style to the GUI styles. :)

Edit:

And remove the $WS_EX_COMPOSITED

Edited by rasim
Posted

n3nE

Add a $WS_CLIPCHILDREN style to the GUI styles. :)

Edit:

And remove the $WS_EX_COMPOSITED

Yes that's better. Sorry I lead people up the wrong path.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted

Rasim, thank you, now it works :o

Martin, you don't need to sorry :)

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted (edited)

Oh... Rasim, I added this in my script with RichEdit and StatusBar, and they are still blinking on resizing with your solution -.-

Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted

Oh... Rasim, I added this in my script with RichEdit and StatusBar, and they are still blinking on resizing with your solution -.-

We would need to see some code to make a sensible reply. If the flicker is solved using $WS_EX_COMPSITED, but you want the buttons to work correctly then maybe you could make it so that you only have the extended style $WS_EX_COMPOSITED when you are resizing the gui.

Here is an example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
 Const $WM_ENTERSIZEMOVE  = 0x231
Const $WM_EXITSIZEMOVE  = 0x232
Global Const $WS_EX_COMPOSITED = 0x2000000
Global $style = BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPCHILDREN)
$Form1 = GUICreate("Form1", 634, 450, 192, 124, $style)
GUISetBkColor(0x000000)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 617, 433)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM)
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_ENTERSIZEMOVE,"startmove")
GUIRegisterMsg($WM_EXITSIZEMOVE,"endmove")
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func startmove()
    ConsoleWrite("Enter sm" & @CRLF)
    $style = GUIGetStyle($Form1)
    GUISetStyle($style[0],BitOr($style[1],$WS_EX_COMPOSITED),$Form1)
EndFunc
Func endmove()
    ConsoleWrite("exit sm" & @CRLF)
    GUISetStyle($style[0],$style[1],$Form1)
EndFunc
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted

We would need to see some code to make a sensible reply. If the flicker is solved using $WS_EX_COMPSITED, but you want the buttons to work correctly then maybe you could make it so that you only have the extended style $WS_EX_COMPOSITED when you are resizing the gui.

Here is an example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
 Const $WM_ENTERSIZEMOVE  = 0x231
Const $WM_EXITSIZEMOVE  = 0x232
Global Const $WS_EX_COMPOSITED = 0x2000000
Global $style = BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPCHILDREN)
$Form1 = GUICreate("Form1", 634, 450, 192, 124, $style)
GUISetBkColor(0x000000)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 617, 433)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM)
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_ENTERSIZEMOVE,"startmove")
GUIRegisterMsg($WM_EXITSIZEMOVE,"endmove")
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func startmove()
    ConsoleWrite("Enter sm" & @CRLF)
    $style = GUIGetStyle($Form1)
    GUISetStyle($style[0],BitOr($style[1],$WS_EX_COMPOSITED),$Form1)
EndFunc
Func endmove()
    ConsoleWrite("exit sm" & @CRLF)
    GUISetStyle($style[0],$style[1],$Form1)
EndFunc
Nice trick martin :) I must add the above code in my script collection :o

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