Jump to content

XP GUI style problem


yawoo
 Share

Recommended Posts

I have designed a GUI frontend and have tested it in windows 2000 without problem.

Posted Image

Posted Image

But someone try it at Windows XP and has got the strange result.

Posted Image

Later, I test the same code at another XP, it shows the same result as my Windows 2000 machine. It seems that someone has got the look as XP GUI style. Is it possible to force the outlook as 2000?

Thanks a lot,

Yawoo

Link to comment
Share on other sites

code?

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

Only showing the GUI coding part.

include <GuiConstants.au3>

Global $sFilename

$wd = @WorkingDir
; GUI
GuiCreate("WinMEnc 0.1 beta", 400, 380)

; General TAB
GuiCtrlCreateTab(10, 10, 380, 270)

GuiCtrlCreateTabItem("General")
$x = 25
$y = 50
$w = 350
$w1 = 250
GUICtrlCreateGroup("Input", $x, $y, $w, 90)
$hFile = GUICtrlCreateInput($sFilename, $x+20,  80, $w1, 22)
$hFileSel = GUICtrlCreateButton("...", $x+$w1+40,  80, 25, 22)
GUICtrlCreateGroup("Output", $x, $y+100, $w, 100)
$hFile2 = GUICtrlCreateInput($sFilename, $x+20, 180, $w1, 22)
$hFile2Sel = GUICtrlCreateButton("...", $x+$w1+40, 180, 25, 22)

; Encode Options TAB
GuiCtrlCreateTabItem("Encode Options")

$x = 30
$y = 50
$w = 80
$wc = 20
GuiCtrlCreateLabel("Video codec:", $x, $y, $w)
$hVideoEnc = GuiCtrlCreatecombo("DivX", $x+$w, $y, $w, 200, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1,"XviD")
GuiCtrlCreateLabel("@", $x+2*$w, $y)
$hVideoBR = GuiCtrlCreatecombo("800", $x+2*$w+$wc, $y, $w, 200, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1,"300|400|500|600|700|1000|1200|1400|1600|2000") 
GuiCtrlCreateLabel("kbps", $x+3*$w+$wc, $y)

$y = $y + 40
GuiCtrlCreateLabel("Audio codec:", $x, $y, $w)
$hAudioHz = GuiCtrlCreatecombo("44100", $x+$w, $y, $w, 200, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1,"22050|32000|48000")
GuiCtrlCreateLabel("Hz", $x+2*$w, $y)
$hAudioBR = GuiCtrlCreatecombo("128", $x+2*$w+$wc, $y, $w, 200, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1,"96|112|160|192") 
GuiCtrlCreateLabel("kbps", $x+3*$w+$wc, $y)

$y = $y + 40
GuiCtrlCreateLabel("Video Size:", $x, $y, $w)
$hVideoSize = GuiCtrlCreatecombo("Original", $x+$w, $y, $w, 200, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1,"320:180|320:240|480:360|512:480|640:360|640:480|320:-3|480:-3|512:-3|640:-3")

$y = $y + 30
$w = 320
$h = 40
$hVHQ = GUICtrlCreateCheckbox ("vhq (Very High Quality for DivX only)", $x, $y, $w, $h)

$y = $y + 40
$w = 320
$h = 50
GuiCtrlCreateLabel("Note: ""-3"" in video size means that the output height is calculated from the specified width and the original aspect ratio.", $x, $y, $w, $h)

; About TAB
GuiCtrlCreateTabItem("About")
$x = 20
$y = 100
$w = 320
$h = 50
GuiCtrlCreateLabel("WinMEnc 0.1 beta, created by Yawoo, 25-Mar-2005", $x, $y, $w, $h, $SS_CENTER)


GUICtrlCreateTabitem ("")

$x = 20
$y = 300
$w = 320
$h = 50
GuiCtrlCreateLabel("Notes: You can change priority when in the progress of encoding: 0 - low; 1 - below normal; 2 - normal; 3 - above normal; 4 - high", $x, $y, $w, $h)

$x = 20
$y = 340
$w = 65
; $hProgress = GUICtrlCreateProgress (20, 315, 360, 20)
$hEncode = GUICtrlCreateButton("Encode", $x,  $y, $w)
$hStop = GUICtrlCreateButton("Stop", $x+$w+10,  $y, $w)
$hPreview = GUICtrlCreateButton("Preview", $x+2*$w+20, $y, $w, $WS_DISABLED)
GuiCtrlCreateLabel("Priority:", $x+3*$w+30, $y, $w, 20, $SS_RIGHT)
$hPriority = GuiCtrlCreatecombo("2", $x+4*$w+40, $y, $w, 200, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1,"0|1|3|4")
Link to comment
Share on other sites

i think its because you use math when you position the controls (im to lazy to actually add it up and debug and stuff)

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

i think its because you use math when you position the controls (im to lazy to actually add it up and debug and stuff)

<{POST_SNAPBACK}>

But all the variables are initialized before using. If the calucaltion is wrong, it should be the same outlook result in windows 2000 and XP machines. Moreover, why some XP got 2000 outlook, and some XP got XP style? Is it possible to force all to use 2000 outlook style?
Link to comment
Share on other sites

You can force XP to use classic look under screen properties - look and classic look but I don't think that's your problem...

I noticed that you forgot # related to 'Include' as #Include but that would produce an error. I got XP at one of my mashines and AutoIt3 Gui works quite well - I would debug the script by exclude sections starting just after create window and have a look at what's happening, I think that this line could do some trouble too:

GuiCreate("WinMEnc 0.1 beta", 400, 380) // you did not provided the window with an ID that should be alright in some conditions but then on the other hand later it could get harder to control the intuition, but I don't know...

But your script got a problem with this line:

$hPreview = GUICtrlCreateButton("Preview", $x+2*$w+20, $y, $w, $WS_DISABLED) // but what's wrong you have to look up your self, something with variable values I say ( x y w h )...

Kjactive

Edited by kjactive
Link to comment
Share on other sites

with that not are you sure you have your order or operations right

B rackets

O Of

D ivision

M ultiplication

A ddition

S ubtraction

and with

$hPreview = GUICtrlCreateButton("Preview", $x+2*$w+20, $y, $w, $WS_DISABLED)

you didnt mean ($x+2) * ($w+20) ?

qq

Link to comment
Share on other sites

But your script got a problem with this line:

$hPreview = GUICtrlCreateButton("Preview", $x+2*$w+20, $y, $w, $WS_DISABLED) // but what's wrong you have to look up your self, something with variable values I say ( x y w h )...

Kjactive

<{POST_SNAPBACK}>

Thanks for your suggestion, finally the problem has been solved.

I have remarked this line, and the XP layout problem has disappeared.

But really don't know why some XP get this layout problem, others not.

Link to comment
Share on other sites

with that not are you sure you have your order or operations right

B rackets

O Of

D ivision

M ultiplication

A ddition

S ubtraction

and with

$hPreview = GUICtrlCreateButton("Preview", $x+2*$w+20, $y, $w, $WS_DISABLED)

you didnt mean ($x+2) * ($w+20) ?

<{POST_SNAPBACK}>

Currently this line is not used, just for reserved future use.

The calucation I want is: $x + 2*$w + 20

it means (x position) + 2*(button width) + (spacing width), something like that.

Anyway, really thanks for your effort to analysis my problem.

Link to comment
Share on other sites

i think its because you use math when you position the controls (im to lazy to actually add it up and debug and stuff)

<{POST_SNAPBACK}>

Thanks for your try to solve my problem. Finally it has solved.
Link to comment
Share on other sites

Although I know that repairing this is a mute point, I do see the issue with the line, the AU3 syntax for a button is:

GUICtrlCreateButton ( "text", left, top [, width [, height [, style [, exStyle]]]] )

In your line:

GUICtrlCreateButton("Preview", $x+2*$w+20, $y, $w, $WS_DISABLED)

Your values for the variables are:

"text" = "Prieview"

left = $x+2*$w+20

top = $y

width = $w

height = $WS_DISABLED (Which would be the value 0x08000000)

XP may treat the hexdecimal value inserted into a decimal field differently than 2k or XP may auto-shuffle the other items on the screen because of the odd height value when in the XP-GUI screen mode.

Tom Brown

Anyone have a TRS 80 Model III for sale?
Link to comment
Share on other sites

Yes - the trouble is that you provide a control height as $WS_DISABLED that represent 0x08000000

$hPreview = GUICtrlCreateButton("Preview", $x $y, $w, $WS_DISABLED) // should be changed to...

$hPreview = GUICtrlCreateButton("Preview", $x, $y, $w, $h, $WS_DISABLED)

This letting parametre out would be okay if there are no further parametre than in your case the width value as autoit inserts the rest as defaults - but it should also provide an error in W2K or any other OS too but what do I know about MS#¤%#%¤# but I think that this is one 'Microsoft speciallity' :)

Kåre

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