|
Home > Archive > Programming with dBASE > October 2005 > More than one popup on one form
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 |
More than one popup on one form
|
|
| Zagrijs Venter 2005-10-24, 8:24 pm |
| Hi All
I know it is possible to attach more than one popup to the same form and
actually did it - years ago.
I did not have any real use for it at the time. I am sure I must have kept
a copy of it, but seems unable to find it now and just cannot recall how to
do it.
Your help is appreciated.
Regards
Zagrijs Venter
| |
| Ken Mayer [dBVIPS] 2005-10-24, 8:24 pm |
| Zagrijs Venter wrote:
> Hi All
>
> I know it is possible to attach more than one popup to the same form and
> actually did it - years ago.
>
> I did not have any real use for it at the time. I am sure I must have kept
> a copy of it, but seems unable to find it now and just cannot recall how to
> do it.
>
> Your help is appreciated.
Change the form's popupMenu property. That's all ...
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
| |
| Robert Bravery 2005-10-24, 8:24 pm |
| HI,
In addition to what Ken has suggested, which is the method I have used many
times. With the onset of subforms, this becomes quite a dream. Create a
subform to look like a popup. You can put graphics html text int or
whatever. Then on a control or someother event, one you would chose,
activate the subform. Be carefull tho when using subforms in this way, as it
could go off th edge of the parent form and dissapear. For this reason I use
a normal form
Works great
Below is a rough example
Robert
* END HEADER -- do not remove this line
//
// Generated on 24/10/2005
//
parameter bModal
local f
f = new UntitledForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class UntitledForm of FORM
with (this)
onRightMouseUp = class::FORM_ONRIGHTM
OUSEUP
height = 11.3182
left = 27.1429
top = 2.1364
width = 60.7143
text = ""
endwith
this.CONTAINER1 = new CONTAINER(this)
with (this.CONTAINER1)
left = 0.0
top = 0.0
width = 60.7143
height = 3.0909
colorNormal = "0x808040"
borderStyle = 9 // Etched In
anchor = 2 // Top
endwith
this.CONTAINER1.TEXT1 = new TEXT(this.CONTAINER1)
with (this.CONTAINER1.TEXT1)
height = 1.5
left = 0.0
top = 0.0
width = 60.1429
anchor = 2 // Top
transparent = true
fontSize = 12.0
fontBold = true
text = "Test Sub-form as a Pop-up"
pageno = 0
endwith
this.CONTAINER1.TEXT2 = new TEXT(this.CONTAINER1)
with (this.CONTAINER1.TEXT2)
height = 1.5
left = 0.7143
top = 1.5455
width = 19.0
transparent = true
text = "Rightclick on the form"
pageno = 0
endwith
function form_onRightMouseUp(
flags, col, row)
pop = new popform(form)
pop.top = row+pop.height-1
pop.left=col+pop.width-1
pop.open()
return
endclass
class popform( oParent ) of form //SubForm( oParent )
with (this)
onLostFocus = {;form.close()}
colorNormal = "azure"
height = 6.7273
left = 49.4286
top = 7.1818
width = 23.8571
text = ""
clientEdge = true
mdi = false
showTaskBarButton = false
smallTitle = true
sizeable = false
moveable = false
sysMenu = false
escExit = false
maximize = false
minimize = false
endwith
this.LINE1 = new LINE(this)
with (this.LINE1)
left = 5.0
right = 23.4286
top = 2.7273
bottom = 2.7273
width = 1
endwith
this.LINE2 = new LINE(this)
with (this.LINE2)
left = 5.0
right = 23.4286
top = 4.6364
bottom = 4.6364
width = 1
endwith
this.TEXT1 = new TEXT(this)
with (this.TEXT1)
height = 6.5455
left = 0.0
top = 0.0
width = 4.8571
anchor = 3 // Left
colorNormal = "0x80ff00/0x404000"
alignVertical = 1 // Middle
fontSize = 14.0
fontBold = true
rotate = 3 // 270 degrees
text = " Menu"
endwith
this.IMAGE1 = new IMAGE(this)
with (this.IMAGE1)
height = 1.0
left = 5.0
top = 0.0909
width = 2.8571
dataSource = "RESOURCE #627"
borderStyle = 3 // None
endwith
this.TEXT2 = new TEXT(this)
with (this.TEXT2)
onLeftMouseUp = class::TEXT2_ONLEFTM
OUSEUP
onMouseOver = {;this.colornormal = "yellow/maroon"}
onMouseOut = {;this.colornormal = "BtnText/azure"}
height = 1.0
left = 8.1429
top = 0.1818
width = 15.4286
colorNormal = "BtnText/azure"
text = "Menu 1"
endwith
this.IMAGE2 = new IMAGE(this)
with (this.IMAGE2)
height = 1.0
left = 5.1429
top = 1.3636
width = 2.8571
dataSource = "RESOURCE #610"
borderStyle = 3 // None
endwith
this.TEXT3 = new TEXT(this)
with (this.TEXT3)
onLeftMouseUp = class::TEXT2_ONLEFTM
OUSEUP
onMouseOver = {;this.colornormal = "yellow/maroon"}
onMouseOut = {;this.colornormal = "BtnText/azure"}
height = 1.0
left = 8.2857
top = 1.4545
width = 15.4286
colorNormal = "BtnText/azure"
text = "Menu 2"
endwith
this.IMAGE3 = new IMAGE(this)
with (this.IMAGE3)
height = 1.0
left = 5.2857
top = 3.1818
width = 2.8571
dataSource = "RESOURCE #170"
borderStyle = 3 // None
endwith
this.TEXT4 = new TEXT(this)
with (this.TEXT4)
onLeftMouseUp = class::TEXT2_ONLEFTM
OUSEUP
onMouseOver = {;this.colornormal = "yellow/maroon"}
onMouseOut = {;this.colornormal = "BtnText/azure"}
height = 1.0
left = 8.4286
top = 3.2727
width = 15.4286
colorNormal = "BtnText/azure"
text = "Menu 3"
endwith
this.IMAGE4 = new IMAGE(this)
with (this.IMAGE4)
height = 1.0
left = 5.1429
top = 5.0
width = 2.8571
dataSource = "RESOURCE #600"
borderStyle = 3 // None
endwith
this.TEXT5 = new TEXT(this)
with (this.TEXT5)
onLeftMouseUp = class::TEXT2_ONLEFTM
OUSEUP
onMouseOver = {;this.colornormal = "yellow/maroon"}
onMouseOut = {;this.colornormal = "BtnText/azure"}
height = 1.0
left = 8.2857
top = 5.0909
width = 15.4286
colorNormal = "BtnText/azure"
text = "Menu 4"
endwith
this.TEXT6 = new TEXT(this)
with (this.TEXT6)
height = 0.7273
left = 10.8571
top = 2.3636
width = 4.2857
transparent = true
fontSize = 8.0
text = "Text6"
endwith
function TEXT2_onLeftMouseUp(
flags, col, row)
msgbox("You clicked me. I am "+this.text,"Click")
form.close()
return
endclass
"Zagrijs Venter" <zcv.eltbaNotPart@lantic.net> wrote in message
news:1NuAZKI2FHA.1108@news-server...
> Hi All
>
> I know it is possible to attach more than one popup to the same form and
> actually did it - years ago.
>
> I did not have any real use for it at the time. I am sure I must have
kept
> a copy of it, but seems unable to find it now and just cannot recall how
to
> do it.
>
> Your help is appreciated.
>
> Regards
>
> Zagrijs Venter
>
>
| |
| Zagrijs Venter 2005-10-27, 7:28 am |
|
Thanks.
Zagrijs
| |
| Zagrijs Venter 2005-10-27, 7:28 am |
| Hi Ken
Feel a bit of a fool. Should have read the OLH properly. However, the OLH
could provide a bit more to make it clear.
I am currently using the onMouseOver and onMouseOut to change the popup. It
works fine except if one fails to click the left mouse button before moving
the mouse cursor to another part of the form.
Zagrijs
"Ken Mayer [dBVIPS]" wrote
>
> Change the form's popupMenu property. That's all ...
>
> Ken
>
| |
| Ken Mayer [dBVIPS] 2005-10-27, 7:28 am |
| Zagrijs Venter wrote:
> Feel a bit of a fool. Should have read the OLH properly. However, the OLH
> could provide a bit more to make it clear.
Sure, but ... <g> In addition, there's at least one article in the
dBulletin that goes into extensive detail of the use of popups ...
> I am currently using the onMouseOver and onMouseOut to change the popup. It
> works fine except if one fails to click the left mouse button before moving
> the mouse cursor to another part of the form.
Might want to re-think that strategy, then ...
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
| |
| Zagrijs Venter 2005-10-27, 7:28 am |
| Haven't ordered your book yet. Do you also deal with the subject in your
book?
Zagrijs
"Ken Mayer [dBVIPS]" wrote
> Sure, but ... <g> In addition, there's at least one article in the
> dBulletin that goes into extensive detail of the use of popups ...
>
>
> Might want to re-think that strategy, then ...
>
> Ken
| |
| Ken Mayer [dBVIPS] 2005-10-27, 7:28 am |
| Zagrijs Venter wrote:
> Haven't ordered your book yet. Do you also deal with the subject in your
> book?
Some. Not in the detail that is in the dBulletin article, but I do look
at them.
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
| |
| Zagrijs Venter 2005-10-27, 7:28 am |
|
"Ken Mayer [dBVIPS]"wrote
In addition, there's at least one article in the
> dBulletin that goes into extensive detail of the use of popups ...
I knew I got the info from somewhere at the time, but forgot where. Thanks
for reminding me about the bulletin.
>
> Might want to re-think that strategy, then ...
I read the article again. As you know, at the time when it was written
onMouseOver and onMouseOut did not exist. Storing references to the popups
in custom properties, changing to the object specific popup onMouseOver and
back to the default onMouseOut, achieves the same result with very little
coding. I included an escape menu on the popup (a menu without an onClick
event) to encourage the user to click something if he/she decides using
anything from the menu. Works well for me.
Regards
Zagrijs
| |
| Ken Mayer [dBVIPS] 2005-10-27, 7:39 am |
| Zagrijs Venter wrote:
> "Ken Mayer [dBVIPS]"wrote
>
> In addition, there's at least one article in the
>
>
>
> I knew I got the info from somewhere at the time, but forgot where. Thanks
> for reminding me about the bulletin.
>
>
>
>
> I read the article again. As you know, at the time when it was written
> onMouseOver and onMouseOut did not exist. Storing references to the popups
> in custom properties, changing to the object specific popup onMouseOver and
> back to the default onMouseOut, achieves the same result with very little
> coding. I included an escape menu on the popup (a menu without an onClick
> event) to encourage the user to click something if he/she decides using
> anything from the menu. Works well for me.
Seems that doing it in the onMouseOver/Out events is a bit much -- if
the control never really gets focus, why change the popup? I would use
the onGotFocus/onLostFocus events ...
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
| |
| Zagrijs Venter 2005-10-28, 7:23 am |
|
"Ken Mayer [dBVIPS]" < wrote
> Seems that doing it in the onMouseOver/Out events is a bit much -- if the
> control never really gets focus, why change the popup? I would use the
> onGotFocus/onLostFocus events ...
Using onMouseOver/Out does seem like an overkill and onGotFocus/onLostFocus
the more obvious way to go until you test it. With onGotFocus you have to
give the object focus first before the popup will be changed and available -
result is efectively a double click. If you click on the form or a disabled
object no change takes place, and you must hunt for another object that can
receive focus, but does not have its own popup, to restore the default
popup.
With onMouseOver/Out the popup is available when you right-click as one
would expect it. Obviously one is only attaching a popup to an object that
will receive focus from time to time and where a specific popup is needed.
Zagrijs
|
|
|
|
|