I shouldn't have said "static text" - it's just a static specifying
SS_BITMAP. Below is the full .RC file.
Thx,
Oliver
// Generated by ResEdit 1.5.9
// Copyright (C) 2006-2011
// <http://www.resedit.net> http://www.resedit.net
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "TestView.h"
//
// Bitmap resources
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDB_BITMAP1 BITMAP ".\\CustList.BMP"
//
// Dialog resources
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG1 DIALOG 0, 0, 186, 95
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION |
WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "Ms Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 129, 7, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 129, 24, 50, 14
CONTROL "", IDC_STATIC1, WC_STATIC, WS_BORDER | SS_BITMAP |
SS_NOTIFY | SS_REALSIZECONTROL, 37, 22, 72, 56
}
//
// Icon resources
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDI_ICON1 ICON ".\\Customer.ico"
_____
From: Mark Miesfeld [mailto:[email protected]]
Sent: 14 February 2012 17:37
To: Open Object Rexx Users
Subject: Re: [Oorexx-users] Problem displaying a bitmap in a static
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