I have a problem showing a bitmap inside a static text in a very simple
RcDialog. 
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!

 
The bitmap does not display. But the double-click works fine!  
 
FYI, here's the whole program without comments or says:

.TestView~newInstance
::REQUIRES "ooDialog.cls"

:CLASS TestView SUBCLASS RcDialog PUBLIC

  ::METHOD newInstance CLASS PUBLIC UNGUARDED
    .Application~setDefaults("O", "TestView.h", .false)
    dlg = .TestView~new("TestView.rc", "IDD_DIALOG1")
    dlg~activate

  ::METHOD activate  UNGUARDED
    self~execute("SHOWTOP","IDI_ICON1")

  ::METHOD initDialog
    expose image
    stImage = self~newStatic("IDC_STATIC1")  
    image = .Image~getImage("IDB_BITMAP1") 
    if \ image~isNull then do
      oldImage = stImage~setImage(image)  
      if oldImage \== .nil then oldImage~release
    end
    else say "TestView-initDialog-03: Error! Image is Null!"

    self~connectStaticNotify("IDC_STATIC1", "DBLCLK", showMsgBox)

  ::METHOD showMsgBox
    ans = MessageDialog("TestView Message")

  ::METHOD leaving
    expose image
    image~release()

Any thoughts? I can send all the files (.rex, .h, .rc, .bmp and .ico) if
required. Btw, I wrote this little test program to check on precisely how
ResEdit deals with directory paths, and to see if there's a simpler way of
making it do the right thing with Exercise06 (and 07) in the Guide.

Many thanks,
Oliver


 

 

 

 
------------------------------------------------------------------------------
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

Reply via email to