Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 25 APR 2000 08:06:52AM Marty Rosenbloom wrote:

How do I center text in an edit line?


At 25 APR 2000 08:40AM Kim Ruane wrote:

Marty,

Edit lines only have left justification.

Try using an edit box instead. Take off the horizontal and vertical scroll bars, and set justification to center. Resize the control as needed. Hope this helps.

Kim Ruane

WinWin Solutions Inc.

www.winwinsol.com


At 25 APR 2000 02:20PM Don Miller - C3 Inc. wrote:

If the EDITLINE is a Symbolic, then you can probably use an OCONV type with justification of T#nn like @ANS=FMT(yourstuff,"T#30"). If its an entry field, then it won't work. I assume you wouldn't want it to either.

Don Miller


At 25 APR 2000 06:13PM Oystein Reigem wrote:

Or worse still - have a CHAR or CHANGED handler using Utility TEXTRECT to continually measure the pixel width of the content and pad with the appropriate amount of spaces, and also update the SELECTION accordingly.

- Oystein -


At 26 APR 2000 12:40AM Richard Hunt wrote:

Hey Marty, good question! I sure wish there was an easy answer. Like mentioned already, I used an edit box so I could center text. I really wonder why there isn't an option for centering.

And still i wonder how windows does certain things. Like windows explorer has those heading "buttons"? interesting how they work. Its those little things that get me thinkin.


At 26 APR 2000 04:57AM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:

Or set up a device context, write the text to the device context as a device independent bit map and position the bitmap within the editline at the rightmost extremity…

The Sprezzatura Group

World Leaders in all things RevSoft


At 26 APR 2000 05:53AM Agent C wrote:

Yeah, but for speed don't forget to double-buffer and bit-blit it. Hmm.. there's always the DirectX API if you really need high performance…But then you'd need a 32-bit thunking layer ….

—————————–7d03011d303f6–


At 26 APR 2000 07:14AM Oystein Reigem wrote:

Agent C my foot! Group member undercover alert!

- Oystein -


At 26 APR 2000 07:39AM Oystein Reigem wrote:

Richard,

And still i wonder how windows does certain things. Like windows explorer has those heading "buttons"? interesting how they work. Its those little things that get me thinkin.

You mean buttons that lie flat and dull in a panel until the mouse cursor passes over, when they sort of spring forward in bright colour? The EXAMPLES app has …uh… an example of that. See the EXAMPLE_MAIN window.

In EXAMPLE_MAIN the implementation of this feature is done with

- one large bitmap containing a picture of all the buttons in their "rest state"

- on top of that one invisible PUSHBMP (button with BMP images) for each button

- some programming that makes a button visible while the cursor passes above it (the windows' WINMSG handler)

- some programming necessary for that WINMSG handler to work

(the windows' CREATE handler).

Do it! It's fun!

- Oystein -


At 26 APR 2000 09:41AM Oystein Reigem wrote:

Sprezz,

How does one set up a device context?

Or how does one get the device context for an existing control?

How can one write text to a device context?

Can one do stuff like this entirely in OI, with Windows API calls?

- Oystein -


At 27 APR 2000 05:17AM Dr C wrote:

Yep, yep and yep…

There are various API calls for dealing with all this such as GetDC(), ReleaseDC(), SelectObject(), DeleteObject() etc etc etc and it's possible to use all of these from inside OI. The Slist Workspace uses them to draw in the gasbar.

However, what you have to remember is that the Presentation Server knows nothing about what you're drawing and so if your window gets covered by another or resized for example the PS won't draw it back in for you. …so you have to do this yourself, which means responding to WM_PAINT messages.

However, all windows messages that you can intercept are only POSTED to you, not SENT, which means there might be a delay in the drawing, and if the engine is busy doing something else (like a SELECT ) then the Basic+ code you need to do the drawing won't get run until later and you get a blank bit.

It can work, I've done it to implement self-sizing tabs in a window, but really the best way to do any of this is too…..subclass and do all your drawing in a DLL ( sorry Don :-)

Dr C


At 27 APR 2000 05:40AM Oystein Reigem wrote:

Dear Mr Dr Agent C,

There are various API calls for dealing with all this such as GetDC(), ReleaseDC(), SelectObject(), DeleteObject() etc etc etc and it's possible to use all of these from inside OI.

So I've gathered. I hope it's just a trivial thing that keeps it from working here. I just made a posting about my problems: . I'd be grateful if you could spare the time to look at it.

However, what you have to remember is that the Presentation Server knows nothing about what you're drawing and so if your window gets covered by another or resized for example the PS won't draw it back in for you. …so you have to do this yourself, which means responding to WM_PAINT messages.

I know. I've already found an old posting by Cameron with some details.

However, all windows messages that you can intercept are only POSTED to you, not SENT, which means there might be a delay in the drawing, and if the engine is busy doing something else (like a SELECT ) then the Basic+ code you need to do the drawing won't get run until later and you get a blank bit.

That's useful information. But it's probably all right for my purposes now.

It can work, I've done it to implement self-sizing tabs in a window, but really the best way to do any of this is too…..subclass and do all your drawing in a DLL ( sorry Don :-)

That's beyond me for now.

Thanks so far.

- Oystein -

Øystein Reigem,

Humanities Information Technologies,

Allégt 27,

N-5007 Bergen,

Norway.

Tel: +47 55 58 32 42.

Fax: +47 55 58 94 70.

oystein.reigem@hit.uib.no

Home tel/fax: +47 56 14 06 11.


At 27 APR 2000 10:58AM Don Bakke wrote:

  • third_party_content/community/commentary/forums_nonworks/b4bd171e4736ed05852568cc00428c4d.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1