Post by joan74 on Aug 25, 2018 7:26:22 GMT
Hi world,
Here a little bug when i try to center my window :
@+
Here a little bug when i try to center my window :
'------------------------'
'BUG with JB1 and JB2.0 '
'Last test: 20180825 '
'------------------------'
nomainwin
call Wm
end
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
sub Wm 'MAIN WINDOW
WindowWidth = 800
WindowHeight = 600
UpperLeftX = int((DisplayWidth-WindowWidth)/2)
UpperLeftY = int((DisplayHeight-WindowHeight)/2)
texteditor #Wm.TxtBox, 20, 20, WindowWidth-50, WindowHeight-150
button #Wm.BtnToWbug, "OPEN WINDOW: CENTER=BUG", [WmToWbug], ul, 50, 490, 250, 38
button #Wm.BtnQuit, " QUIT ", [WmQuit], ul, (WindowWidth-134)/2, 490, 134, 37
open "Main Windows" for window_nf as #Wm
#Wm, "trapclose [WmQuit]"
#Wm.TxtBox, "MAIN WINDOW IS CENTER"
#Wm.BtnQuit, "!setfocus"
wait
'---events -------------------------'
[WmToWbug]
call Wbug
wait
[WmQuit]
msg$ = "PLEASE CONFIRM ?"
confirm msg$; WmQuit$
if WmQuit$ <> "yes" then
wait
end if
[WmClose]
close #Wm
end sub
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
sub Wbug
WindowWidth = 1024
WindowHeight = 768
UpperLeftX = int((DisplayWidth-WindowWidth)/2)
UpperLeftY = int((DisplayHeight-WindowHeight)/2)
texteditor #Wbug.TxtBox, 20, 20, WindowWidth-50, WindowHeight-150
button #Wbug.Btn, "QUIT", [WbugQuit], ul, (WindowWidth-134)/2, 675, 134, 37
open "WINDOW with BUG" for dialog_modal as #Wbug
#Wbug, "trapclose [WbugQuit]"
msg$ = "THIS WINDOW CAN T TO BE CENTER with standard formule :/ ... (unless JB DEBUGGER IS ACTIVE)"; chr$(13); chr$(13)
msg$ = msg$;"UpperLeftX = int((DisplayWidth-WindowWidth)/2) = ";str$(UpperLeftX); chr$(13)
msg$ = msg$;"UpperLeftY = int((DisplayHeight-WindowHeight)/2) = ";str$(UpperLeftY); chr$(13)
#Wbug.TxtBox, msg$
#Wbug.Btn, "!setfocus"
wait
[WbugQuit]
close #Wbug
end sub
@+