|
Home > Archive > Programming with dBASE > February 2006 > getting rid of window x option
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
getting rid of window x option
|
|
| Charlie Lutz 2006-02-25, 9:36 am |
| In miscapi.prg there are a couple of routines that are supposed to
disable the x - close option on a form. One of them is
NoSysCloseBtn( formname )
If I am calling a form with Do default.wfm with true, how do I make this
work or do I need to instantiate the form and call it that way?
Thanks,
Charlie
--
____________________
________
Charlie Lutz
#1000441
| |
| Marc Hamelin 2006-02-25, 9:36 am |
| Use it in the onOpen event of the form. It is triggered regardless of
whether you use open() or readModal().
Marc Hamelin
| |
|
| HI,
I'm assuming that because you want the "X" button removed that you have a
readmodal form
But in any case, try the following. In all cases the X button (all systom
buttons) are not visible. This is because the sysmenu is set to false and
mdi is set to false. No use of API. But the downside is all system buttons
are invisable. If you need to disable individual ones, then api is the only
way to go, Then I would pu that into the onopen event of the form
Robert
do nox.wfm
do nox with true
do nox with false
set proc t nox.wfm addi
nox = new noxform()
nox.readmodal()
nox.open()
** END HEADER -- do not remove this line
//
// Generated on 23/02/2006
//
parameter bModal
local f
f = new noxForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class noxForm of FORM
with (this)
height = 13.0
width = 63.1429
mdi = false
sysMenu = false
endwith
this.PUSHBUTTON1 = new PUSHBUTTON(this)
with (this.PUSHBUTTON1)
onClick = {;form.close()}
height = 1.0909
left = 51.4286
top = 11.6364
width = 11.7143
text = "Close"
endwith
endclass
"Charlie Lutz" <lutzc@(remove)wes.army.mil> wrote in message
news:MPG. 1e6686d03f20e68b9896
d1@news.dbase.com...
> In miscapi.prg there are a couple of routines that are supposed to
> disable the x - close option on a form. One of them is
> NoSysCloseBtn( formname )
>
> If I am calling a form with Do default.wfm with true, how do I make this
> work or do I need to instantiate the form and call it that way?
>
> Thanks,
> Charlie
>
> --
>
>
> ____________________
________
> Charlie Lutz
> #1000441
| |
| Charlie Lutz 2006-02-25, 9:36 am |
| In article <PMf2KRGOGHA.592@news-server>, me@u.com says...
> HI,
> I'm assuming that because you want the "X" button removed that you have a
> readmodal form
> But in any case, try the following. In all cases the X button (all systom
> buttons) are not visible. This is because the sysmenu is set to false and
Robert,
They sysmenu = false is exactly what I needed for this situation.
Thanks for pointing it out.
Charlie
--
____________________
________
Charlie Lutz
#1000441
| |
| Charlie Lutz 2006-02-25, 9:36 am |
| In article <dAsxbN$NGHA.1740@news-server>, m.hamelin@nospam-rasakti.com
says...
> Use it in the onOpen event of the form. It is triggered regardless of
> whether you use open() or readModal().
>
> Marc Hamelin
>
Marc,
I was trying to put it in the on open event, but could not get it to
work. It kept telling me the form name I used was an unknown variable.
Obviously I had something wrong.
The sysmenu = false does what I need in this case.
Thanks,
Charlis
--
____________________
________
Charlie Lutz
#1000441
| |
| Marc Hamelin 2006-02-25, 9:36 am |
| Here's a small turnkey that works for me:
****************
parameter bModal
local f
f = new TestForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class TestForm of FORM
with (this)
onOpen = class::FORM_ONOPEN
height = 16.0
left = 53.0
top = 0.0
width = 40.0
text = "Test Form"
endwith
this.PUSHBUTTON1 = new PUSHBUTTON(this)
with (this.PUSHBUTTON1)
onClick = class::PUSHBUTTON1_O
NCLICK
height = 1.0909
left = 15.0
top = 4.0
width = 15.2857
text = "Close"
endwith
function FORM_onOpen
class::SysClose(this
, false)
return
function PUSHBUTTON1_onClick
form.close()
return
function SysClose(oForm, lEnabled)
local hMenu, lRetVal
if type("GetSystemMenu") # "FP"
extern CINT GetSystemMenu(cHandl
e, cLogical) USER32
endif
if type("EnableMenuItem") # "FP"
extern CLOGICAL EnableMenuItem(cHand
le, cInt, cInt) USER32
endif
hMenu = GetSystemMenu(oForm.hWnd, false)
if lEnabled = true
lRetVal = EnableMenuItem(hMenu
, 0xF060, 0x00000000)
else
lRetVal = EnableMenuItem(hMenu
, 0xF060, 0x00000001)
endif
return not lRetVal
endclass
****************
Hope this helps.
Marc Hamelin
| |
| Charlie Lutz 2006-02-25, 9:36 am |
| In article <kqzfnsKOGHA.592@news-server>, m.hamelin@nospam-rasakti.com
says...
> Here's a small turnkey that works for me:
Marc,
Thanks, I think <g>. That is so over my head I am going to have to try
and figure out what you have done. Seems the more I learn, the less of
the whole I find out I know!
Charlie
--
____________________
________
Charlie Lutz
#1000441
|
|
|
|
|