Warning [2] is_dir() has been disabled for security reasons - Line: 119 - File: inc/init.php PHP 7.1.33 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
[PHP] errorHandler->error_callback
/inc/init.php 119 is_dir
/global.php 20 require_once
/showthread.php 28 require_once
smart Window placement
The following warnings occurred:
Warning [2] is_dir() has been disabled for security reasons - Line: 441 - File: global.php PHP 7.1.33 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
[PHP] errorHandler->error_callback
/global.php 441 is_dir
/showthread.php 28 require_once




smart Window placement
#1
This is an example of a way to save Window settings yet always display the whole window when the program opens.


sub OpenWindow()
local x
local y
x=150 : y=150
if (open(1,"/boot/home/config/settings/myprogram.settings"))then
line input #1 x$
line input #1 y$
close #1
x=val(x$)
y=val(y$)
if x<0 x=150
if y<0 y=150
if (x> peek("desktopwidth")-500) x=150
if y> (peek("desktopheight")-500) y=150
end if

window open x,y to x+500,y+500, "MainWindow", "myprogram"

// set up the Window

end sub

sub CloseWindow()

x= window get "MainWindow", "Position-X"
y= window get "MainWindow", "Position-y"
open #1,"/boot/home/config/settings/myprogram.settings","w"
print #1 str$(x)
print #1 str$(y)
close #1
window close "MainWindow"
return
end sub
Reply
#2
I've been doing much the same thing: if the window is not going to be displayed properly, restore it to a default position, Useful if your user has changed to a lower screen resolution. But an alternative is to take it down in steps.

while(x> peek("desktopwidth")-500))
x = x-20
wend

20 pixels is roughly the height of the Haiku window tab, so when you run this routine on y you don't end up with a window that has its tab sticking up above the top of the screen.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)
Free Web Hosting