Hi Clarion people , quick question , I need to have a small pos it window (message) to show at random places inside a window and have not idea how to code it . the idea is to come up with different reminders that are scattered around the screen / app window .
If anybody has use / code // or just plain guide me will be really great …
How about using GETPOSITION on your main application window to get some idea of its width and height, then create your own message procedure with a window positioned using SETPOSITION ?
Hi Paul, thanks for the comment , I have just basic Windows and small databases knowledge , and couldn’t find any code in the Help section to just do that , if you can share a simple code and where to insert in the embedded section will really appreciate. Unfortunately with clarion sometimes some of the basic coding are hard to understand . thanks ,
You don’t mean a ToolTip do you?
That’s a part of the control and can popup text when the mouse is over the control.
If so you can set that in the control properties
Need to know what you mean by “Window” and/or what kind of Windows. Some screen captures of what you have now will help.
What is the underlying Window MDI or Non-MDI or a Frame ?
In your “Message Window” before the Open(Window) you will still be able to access the previous (under) window (in the same thread) using GETPOSITION() so you can read it’s position.
Off the cuff and untested…
!Data definitions Embed
UwX LONG !Under Window Position X / Y
UwY LONG
UwW LONG ! Width
UwH LONG ! Height
MsX LONG !Message Window Position (Original)
MsY LONG
MsW LONG
MsH LONG
RnX LONG !Random Message Window Position over Under Window
RnY LONG
......
!This code in Message Procedure embed BEFORE Open Window
0{PROP:Pixels}=True !Needed if different Fonts, good idea even if fonts same
GETPOSITION(0,UwX,UwY,UwW,UwH) !Get Under Window Position
0{PROP:Pixels}=False
!Open(Window) or ThisWindow.Init() SELF.open(Window)
!This code in Message Procedure embed AFTER Open Window + AFTER Resize
!Resize.Init() may not be present
0{PROP:Pixels}=True !Needed if different Fonts, good idea even if fonts same
GETPOSITION(0,MsX,MsY,MsW,MsH) !Get Under Window Position
RnX = RANDOM(UwX,UwX+UwW - MsW) !Random X over width of Under Window
RnY = RANDOM(UwY,UwY+UwH - MsH)
SETPOSITION(0,RnX,RnY)
0{PROP:Pixels}=False
Thank you vey much ! I did it and it works , I love clarion but I found very difficult to do some of the coding , unfortunate is very hard to find help , once again thanks for your generosity and time .
BTW the windows was just a message , and sometimes my program generate several messages and having one on the top of another was an inconvenient , but generating a random position help me to know that have x messages .
sometimes my program generate several messages and having one on the top of another was an inconvenient
Just a thought: you can have your messages automatically added to file. This might work for you: to be able to see your messages, perhaps the last few, or whatever. For example, you can then sort them or search them or filter them, normal things you do for files.
This is what the MessageBox template from CapeSoft does. https://www.capesoft.com/accessories/mesboxsp.htm
-Bob