Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#1365 closed Bug (No Bug)

Windows 2000: GUICtrlCreateLabel before GUICtrlCreateCombo prevent pulldown popup

Reported by: Mulder Owned by:
Milestone: Component: AutoIt
Version: 3.3.2.0 Severity: None
Keywords: Cc:

Description

This is a very old bug (3.1.1.127 own this bug too)

If ( a GUICtrlCreateLabel exists before GUICtrlCreateCombo ) AND ( the OS is windows 2000) Then
The popup window with all values is not displayed
Endif

On XPsp2 there is no such problem
Tested this with my W2ksp4 setup and a W2ksp4 VMmachine
Remove the GUICtrlCreateLabel before GUICtrlCreateCombo and it will work on W2k too

Testscript
will generate 2 GUICtrlCreateCombo but the second is coded after GUICtrlCreateLabel
(on GUI: first Label then Combo_1 and Combo_2)
and not working while the first one is.
Again:
On XPsp2 there is NO problem
On Windows 2000 sp4 (patched)
The Label is displayed
the Combo (item1....) is displayed AND working
the Combo (native|pentium"....) is displayed but NOT working (popup)

A work arround is to code all GUICtrlCreateLabel after any other GUI element.


Opt("GUIOnEventMode", 1)

#include <GUIConstants.au3>

GUICreate("My GUI combo") ; will create a dialog box that when displayed is centered

GUICtrlCreateCombo("item1", 20, 35) ; create first item
GUICtrlSetData(-1, "item2|item3", "item3") ; add other item snd set a new default

GUICtrlCreateLabel ( "This is a test", 10, 10 , 150, 20)
GUICtrlSetBkColor(-1, 0x00ff00)

GUICtrlCreateCombo( "", 20, 75, 150 )
GUICtrlSetData( -1, "native|pentium|pentium3|pentium-m|pentium4|prescott|nocona|core2|athlon-xp|k8|k8-sse3|amdfam10" )

GUISetState()

while 1

sleep(5000)

wend


Attachments (1)

Bild6.png (7.8 KB) - added by Mulder 14 years ago.
a screenshot of the GUI on w2k and Xp

Download all attachments as: .zip

Change History (6)

Changed 14 years ago by Mulder

a screenshot of the GUI on w2k and Xp

comment:1 Changed 14 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

Please read the documentation for GUICtrlCreateCombo().

comment:2 Changed 14 years ago by Mulder

I know Autoit is free ...

Under Windows XP/2003 Windows will adjust the size of the opened combo. On other Windows versions you can define this size with the "height" parameter if the default value is not BIG enough to contain at least one line.

But than this problem must occur at any time
not only if i had another gui element in front of a Combobox

If i "initialize" my combo first
and then later reset the Pos and add infos to it it will work

If you dont want to change it 'couse you need to rewrite a lot of code
add this info in big red letters into the doc

This script will work on W2k and XP


Opt("GUIOnEventMode", 1)

#include <GUIConstants.au3>

GUICreate("My GUI combo")

$test = GUICtrlCreateCombo( "item1", 1, 1)
$test2 = GUICtrlCreateCombo( "", 1, 1, 1 )

GUICtrlCreateLabel( "This is a test", 10, 10 , 150, 20)
GUICtrlSetBkColor( -1, 0x00ff00)

GUICtrlSetPos( $test, 20, 35 )
GUICtrlSetData( $test, "item2|item3", "item3")

GUICtrlSetPos( $test2, 20, 150, 150 )
GUICtrlSetData( $test2, "native|pentium|pentium3|pentium-m|pentium4|prescott|nocona|core2|athlon-xp|k8|k8-sse3|amdfam10" )

GUISetState()

while 1

sleep(5000)

wend


comment:3 Changed 14 years ago by Valik

I went to all the trouble of installing Windows 2000 to a virtual machine to test your stupid script. Immediately after the I spent a half hour getting that taken care of I noticed you weren't even specifying a height parameter in your example script. What you're saying is we should rewrite the code or rewrite the documentation (Documentation that already documents the problem you had!) because you can't be arsed to do what the documentation says and specify a proper height parameter? I easily reproduced your problem on Windows 2000 and the moment I ran a script with a proper height setting it started working.

What I'm saying in short is this: Write good code that conforms with the documentation the language provides or piss off. Failing to heed the remarks in the documentation, having those remarks pointed out then telling us to fix it anyway is just asinine to put it mildly.

There is no bug here. Everything is working as designed with the idiosyncrasies of different Windows versions. It's fully documented as well. Subject closed.

comment:4 Changed 14 years ago by Mulder

And I thought help is welcome...

I never forced anything!
I've just pointed my finger to somthing that seems strange to me
and because english is'nt my native language im not realy able to weigh one's words

If i get a return where is obvious that the "problem" is not understood
i'll try to explain it a 2nd time.
You still dont want see what im talking about.
I know about that hight parameter but that is not the point

The point is
that this is not needed if you create a combo before any other gui element
Thats all!

I'm not talking about fixing it
just to let you know about that.
I've just chosen "bug" in the report (what else should i have done?).

The doc btw. dont clarify
that without the hight parameter the combo is broken on a W2k machine.

At the end i must say
im disappointed
While reaching a helping hand i'm called stupid and better should piss off

comment:5 Changed 14 years ago by Valik

Telling us something we know and have documented doesn't help. When you do not specify a parameter AutoIt uses an internal default. I don't know what it defaults to and I don't care to look. Its probably using your last specified height (if you specified one). In your example this last used height is too small. If no height was specified at all then it uses a different internal value which is clearly large enough. That doesn't change the fundamental problem, however, which is your code. You refuse to specify a height parameter knowing full well (being that its documented) that you have to specify an unusually large height on Windows 2000 in order for the control to appear correctly.

If you try to take the lazy way out and it doesn't work, its not necessarily a bug. It just means you need to stop being lazy. The fact that its documented that the height parameter is important on Windows 2000 should be your first clue you need to explicitly control it yourself and not leave it up to chance.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.