On Tue, Feb 14, 2012 at 9:05 AM, Oliver Sims <
[email protected]> wrote:
> **
> I have a problem showing a bitmap inside a static text in a very simple
> RcDialog.
>
>
The problem is in your description above. Static *text* controls can not
display an image. The static control has to have the SS_BITMAP style to
display a bitmap. It has to have the SS_ICON style to display an icon.
Check your .rc file and you will see that it doesn't have the SS_BITMAP
style. In ResEdit, check the properties for the static control and set the
one that gives it SS_BITMAP style. As I recall, if you click on each
property of a control, ResEdit has a status bar that gives you a hint as to
what it does.
>
> I've no idea what's going wrong. I've checked and re-checked the .rc and
> .h files.
> Everything works fine except the bitmap does not appear.
> Either there's a problem in ooDialog, or I'm off my trolley. Here's the
> relevant
> method:
>
>
> ::METHOD initDialog
> expose image
> stImage = self~newStatic("IDC_STATIC1") --Create a static text
> proxy.
> say "TestView-initDialog-01: stImage =" stImage
> image = .Image~getImage("IDB_BITMAP1") -- Create an image from the
> bitmap
> say "TestView-initDialog-02: image =" image
> if \ image~isNull then do
> oldImage = stImage~setImage(image) -- set the image into the
> static control
> if oldImage \== .nil then oldImage~release
> end
> else say "TestView-initDialog-03: Error! Image is Null!"
>
> -- Provide for a double-click on the image:
> self~connectStaticNotify("IDC_STATIC1", "DBLCLK", showMsgBox)
>
>
> The console oputput is:
>
>
> D:\ ... \Test2>testview
> TestView-initDialog-01: stImage = a Static
> TestView-initDialog-02: image = an Image
> TestView-initDialog-03: Error! Image is Null!
>
>
Your output message is a little misleading. The first time you set the
image, you will get .nil back because there was no previous image. That's
not an error, it is to be expected.
I'm fairly sure this will work if you use the proper type of static
control. If it still doesn't work, then let me know.
--
Mark Miesfeld
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users