I'm using the MSG function to display 4 buttons.
ans=msg("","Replace?":@fm:"B&Replace,&Find Next,Replace &All,&Cancel")
If the user clicks on button 1,2 or 3 then the value returned is the button number (1 2 or 3)
but if they select the 4th button, the value returned is 1. Interestingly, I can't get more than 4 buttons to display. I'm using OI ver 3.4.1
Any ideas?
Paul,
Try
ans=msg(@Window,"Replace?":@fm:"B&Replace,&Find Next,Replace &All,&Cancel")
(Do it from a window and not from the System Editor.)
I think perhaps you get a different Msg function when you run without a first parameter (which is the parent window of the message box). I think it is something with backwards compatibility with Arev???
- Oystein -
My playing with the subject led me to believe that Windows only supports 3 button messages - anything else is a dialog box masquerading as a message.
amcauley@sprezzatura.com
World Leaders in all things RevSoft
…anything else is a dialog box masquerading as a message.
Isn't that what OI message boxes are?
dbakke@srpcs.com
Hmm, good point… and we have the source don't we so I could have checked before I posted ;-(
amcauley@sprezzatura.com
World Leaders in all things RevSoft
seems like this threed is a couple of years old, but didn't see any real answer. according to the documention, msg ONLY allows upto 3 buttons. Does anyone know of a method or a workaounrd to get more then 3 buttons??
tia
As implied in the thread you can modify the MSG source to display more or you can write your own routine.
World Leaders in all things RevSoft
Well – i looked at MSG and did make a copy and modify it. I could see where the code was only looking to return either 1,2 or 3 as the response. Ran the modified version with debug on and MSG then calls DIALOG_BOX and that is where the actual display comes from, which ALSO has a limit in it - since only 4 buttons showed up, and not the 5 that i had requested. Since the source for DIAL_BOX isn't provided (or is located somewhere I couldn't find) - that didn't work.
any suggestions????
Did you modify the MSG window which by default only has four buttons too?
World Leaders in all things RevSoft
i made a copy of the MSG function and renamed it. then looked at the area where the count of the button pressed is determined, and there is code to only return 1,2 or 3 plus ESC is you use the Boption.
changed my event to call my renamed program, and still only 4 buttons came up and not the 5 i had passed in. Further review of MSG found a call to DIALOG_BOX which is where the actual display comes from. This function, as far as i could determine, is the actual program showing the msg and the buttons. the source to DIAL_BOX is not distributed, as far as I can tell.
the programers reference does state that you can/should only use up to three buttons. just thought this a rather limiting factor, and while changing MSG might be an option, obviously there is other code that needs to be modified/changed also.
on a different subjuct, I also noticed some posting with regards to sorting a POP_UP screen by a column. Has anyone figured out a work around for the sort NOT working on a 'date' column???
thanks
Jay,
i made a copy of the MSG function and renamed it. then looked at the area where the count of the button pressed is determined, and there is code to only return 1,2 or 3 plus ESC is you use the Boption.
You didn't read Sprezz's response correctly. There is also a window called MSG that you will need to modify from within the Form Designer. This is the form that the Dialog_Box routine calls and where the limit on the number of buttons is maintained.
on a different subjuct, I also noticed some posting with regards to sorting a POP_UP screen by a column. Has anyone figured out a work around for the sort NOT working on a 'date' column???
This has been fixed within the latest (32-bit) version of OpenInsight. However, people have posted how to change the existing code to make it work right now. Here one link and here is
dbakke@srpcs.com
Indeed sorting dates, etc. has been fixed.
Undocumented is that Shift + DblClk does reverse order sort.
Also, if you use popup for a multiple preselect, then abort returns null - but also deselecting all and OK also returns null. Thus you don't know which the user has done!
I've pointed this out repeatedly to RTI, as an extra flag in the params could be used to indicate that Esc should be returned for abort or null for null select. No reaction!
However, it's easy to mod the code to do this. See my experimental "toolkit" area at www.tornadopropsys.co.uk/toolkit for a suggestion.
There's also a potential problem (or inconvenience or feature) with literal popups in that, if you don't want the popup to display the literal columns as found by using explicit column positions, you find it delivers "as found" regardless! Again not a difficult mod.
thanks for clue Don. I didn't realize that the MSG window also had to be modified. Seems to be working now.