How do I make push button text to wrap or multi-line?
Kauko,
With a standard pushbutton you can't. You can get around this by creating a PUSHBMP control instead or using an OLE button control.
dbakke@srpcs.com
My fordesigner toolbox has OLE controls in it but no OLE BUTTON control?
Kauko,
That's right. OI has provided you the ability to plug in third-party or home grown OLE controls. Revelation does not supply any controls.
We have developed a suite of OLE controls, including a pushbutton, so feel free to contact us if you want more information. In the meantime, if you want to get quickly up to speed on using OLE in OpenInsight we have a free white paper that you can download here.
dbakke@srpcs.com
Kauko,
What about that first suggestion of Don's - using a PUSHBMP? Are you familiar with PUSHBMPs?
Of course PUSHBMPs have drawbacks. Their face is a static image so the text/font/etc can't be set programmatically. And they take some work to create.
Here's an example of a PUSHBMP bitmap so you can judge for yourself how much work's involved. (My example button has an image and not a text but that shouldn't make much difference.)
- Oystein -
I can't find any info about PUSHBMP in the help except that it's one of the controls?
Kauko,
Sorry, I just assumed you already knew how to create one. All you do is go to the properties dialog for your regular push button control. At the bottom will be a place to enter the Bitmap Entity. Just select the image you want to display on your button, spacify the number of images (i.e. in Oystein's example you would put a 6), and voila! You now have a PUSHBMP control.
dbakke@srpcs.com
Kauko,
It's just a pushbutton. I don't know why they (I) call it PUSHBMP like it was a different control.
If you want to try it you can use the bitmap that I posted (save it to your own PC first). Make a form with a pushbutton. Size the pushbutton to 30x30 pixels. In the Push Button Properties set Bitmap Entity to the bitmap (Press Create Entity, press Browse, locate the file, etc). Set Number of Images to 6, and tick Clip. Test Run.
- Oystein -
Oystien,
I don't know why they (I) call it PUSHBMP like it was a different control.
Because technically it becomes a PUSHBMP control when you add the bitmap. Look in your SYSREPOSWINS record and you will see the control type as PUSHBMP. Same with CHECKBMP and RADIOBMP.
Functionally, of course, it is the same control.
dbakke@srpcs.com
Don,
OK, but it is confusing to a person new to OI.
There are no index entries for PUSHBMP etc in OINSIGHT.chm. And a Search only leads to a page with a list of all control types and no explanatory text at all.
In ProgRef.chm there are no index entries for controls at all. (Personally I think there should be.) A Search leads to several articles that all assume you know what a PUSHBMP etc is. The CLICK article is the only one which gives a hint to what these controls are about.
I'll mail Ira.
- Oystein -
Hi Oystein,
I'll be adding examples about the various types of "BMP" type controls to the Programming Examples chapter of the Programmer's Reference.
I must confess I was also confused about whether these were different types of controls as opposed to the base control (PUSHBUTTON) with an extra attribute (a bitmap). This thread clarifies things nicely.
Please email me (ira@irakrakow.com or ikrakow_1999@yahoo.com) with any other suggestions for examples.
Best wishes.
Ira
I have used bitmap in many push button when pciture is needed but to add properly sized text to those is a pain.
Kauko,
Needing to create a BMP in the first place is a pain. I think it is rather easy to add the text. What program are you using to create these BMPs?
dbakke@srpcs.com
Kauko,
It can be done, although with some OI issues! There is a button style called "BS_MULTILINE" (value 8192 or 0X2000). It is possible that this style must be implemented at time of creation.
1) I tried this on a plain "push button", bad news is that it did not work for me.
FOCUS=@WINDOW:'.BUTTON_1'
HANDLE=GET_PROPERTY(FOCUS,'HANDLE')
BM_SETSTYLE=244
BS_MULTILINE=8192
REDRAW=1
RESULT=SENDMESSAGE(HANDLE,BM_SETSTYLE,BS_MULTILINE,REDRAW)
2) Then I tried this, some good news… it worked. Then the bad news… Revelation does not allow this 'destroy / create' method within a runtime.
STRUCTURE=GET_PROPERTY(FOCUS,'ORIG_STRUCT')
STYLE=STRUCTURE
STYLE=ICONV(STYLE3,999,'MX')
STYLE=BITOR(STYLE,BS_MULTILINE)
STRUCTURE=STYLE
RESULT=UTILITY('DESTROY',FOCUS)
RESULT=UTILITY('CREATE',STRUCTURE)
3) An alternative would be to edit the "SYSREPOSWINEXES" row for the form. Modify the style in that row, and then save it.
If my testing is true, then I would guess that Revelation would allow for option 2 since currently it is not possible to select the "multiline" style during development of the form and control. Although Revelation would have to make that decision.
More style equates you might be interested in…
BS_BOTTOM=2048; places text at the bottom.
BS_CENTER=768; centers text horizontally.
BS_LEFT=256; left-justifies the text.
BS_RIGHT=512; right-justifies the text.
BS_TOP=1024; places text at the top.
BS_VCENTER=3072; places text in the middle (vertically)
Kauko,
Are you sure you need a multi-line button at all?
I assume you (1) have this long text for your button, (2) can't think of a shorter text that describes the button's action, and (3) for some reason of layout can't have the button wide enough for all the text to fit.
Here's a suggestion: Make do with a shorter text - one that's less precise but understandable to those who've used the system before. For the novice have balloon help (tooltip) with the full text. (I think you can make balloon help for buttons either by using the | syntax or the HELPTEXT property.)
- Oystein -
Oystein,
Tooltip/Balloon help will only work with PUSHBMP controls.
dbakke@srpcs.com
Don/Kauko,
Tooltip/Balloon help will only work with PUSHBMP controls.
Nei, huffameg da!
![]()
The HELPTEXT article says the HELPTEXT property gets or sets text to be displayed as balloon help, and that it applies to all controls. (Ira - are you there?)
Myself I've used Sprezzatura's tooltip product so long I forget the limitations of OI's version.
Kauko - I know you have reservations about pushbbmps, but making them might be less work than you think. If you have a decent image editor (PhotoShop) I can give you some useful advice.
Richard's suggestion is a good one, though, if Revelation allows it. I really think they should.
- Oystein -
If you have a decent image editor (PhotoShop) I can give you some useful advice.
Honestly, for BMP images used for buttons we have found that good ole' MS Paint is far easier and quicker to use than the higher end graphics programs.
dbakke@srpcs.com
Don,
Right. Let's compete. We'll have Kauko mail us his text and we'll see who's got the pushbmp finished first.
![]()
- Oystein -
Dear Revelation,
Richard's "solution" is a classic case where I believe it would be relatively easy to open up the style settings for all controls to developers so we don't have to go through this kind of effort.
For whatever reason, old RevSoft limited the variety of styles that could be chosen. We often have to use Utility DESTROY/CREATE, Send_Message/COLSTYLE, or Set_Property/STYLE approaches. Or, as Richard suggested, we can manually modify the SYSREPOSWINEXES record…which is fine until the window gets recompiled again.
Adding additional styles to the control properties dialog box should not conflict with existing applications in the way other "fixes" might (cf. the Alt-F4 thread currently going on.)
dbakke@srpcs.com
I just changed the code such that all push buttons will be able to do multiline text (with left, right or center justification) and this will be available in OI 7.0. If you just enter one line of text, then it will act like the current pushbuttons (it will be a single-line of text, centered verticaly), but you can add as many lines of text as you like in the button properties and as many will show as the button is big enough to display. The text, single or multiline, will be centered top to bottom and you can choose in the properties if you want it with left, right or center justification (center is the default like the current buttons).
I hope this is what most of you want! :)
Jim
Jim,
I just changed the code such that all push buttons will be able to do multiline text.
Wicked. Now I can have small poems on my buttons.
- Oystein -
Yup, and we will hold an annual poetry contest, with all entries submitted as OI apps with the poems on pushbuttons…
:)
Jim
Jim,
That's a really good idea. But remember - I had the "Poems on buttons" idea first, so you'll have to find a special place for me in the scheme, like be in the panel of judges. I even think it could be an original idea. I searched the web but couldn't find any poetic pushbuttons. It really gives me this nice feling inside. "Poems on buttons". A poetic phrase in itself. Like straight out of "My Favourite Things".
- Oystein -
Jim ..
Adding that in is/was (what have you done form me in the last 20 seconds
but I wonder ..
To follow on Donald's *question* what can be done to open the control so that we can do what we wish. If i remember right there were some legal restrictions about what could be done. Have those been cleared up. Are the applicable here?
Thanks
dsig@sigafoos.org
David Tod Sigafoos
SigSolutions, Inc.
]]To follow on Donald's *question* what can be done to open the ]]control so that we can do what we wish. If i remember right there ]]were some legal restrictions about what could be done. Have those ]]been cleared up. Are the applicable here?
This is a question I will have to defer to Mike on. I don't know what the legal restrictions, if any, are or how "open" the controls *could* or *should* be to users, etc.
How's that for passing the buck! :)
Sorry I don't have a better answer for you but I'm sure Mike can provide one.
Jim
And one of these days I'll figure out how to get those ]]" thingies in correctly in a response!
Jim,
If I understand David's question correctly, we won't have to worry about "legal restrictions" all controls can be updated in the same way you updated the pushbutton control. This goes back to my original request, i.e., to open up the style settings for all controls to include more than what we are currently allowed. Since these options would be available to us at design time, we won't have to worry about destroying and re-creating controls in a runtime to achieve the same affect.
What you did for the pushbutton is wonderful. If we could extend this to other the controls on the palette then all of life would be wonderful! (well…almost )
dbakke@srpcs.com
Don,
What additional controls (if any) to extend the multi-line text to will be something I will have to talk to Mike about. Some controls may make more sense to extend this to than others.Jim
Unless we're very much mistaken the request is for EVERY style bit of EVERY control to be exposed as a property to that we don't have to create and destroy to modify certain styles.
The Sprezzatura Group
World Leaders in all things RevSoft
OK - I will have to discuss this with Mike.
Thanks!
Jim
Jim,
What Sprezz said is exactly what I was trying to say. Thanks Sprezz for the clarification.
dbakke@srpcs.com
Guys-
We'll probably need to leave this for 7.x, not 7.0
Thanks-
Mike Ruane