On approximately 4/26/2004 9:40 AM, came the following characters from
the keyboard of Laurent ROCHER:
Hi All,

    I commit new changes.
        - Window properties now re-work.

Good :) :)

        - Handle correctly Window life and Perl variable life
         (i hope it work because i loose my hair on it ;o)
        - Add MDI window support (3 new class MDIFrame, MDIClient and
MDIChild).

    For MDI, i have add a sample in Samples directory.

This sounds good, and looks good. Unfortunately, not compatible with old Win32::GUI::MDI. I wonder if there is any way to have the added functionality you are producing, and still be compatible with the old code. My old code was:

# MDI window

$mdi_window = Win32::GUI::MDI->new (
  -name => 'mdi_window',
  -parent => $mw,
  -text => 'MDI',
  -top => 0, -left => 0,
  -width => $mwsw, -height => $mwsh - 40,
  -visible => 1,
  );
if ( ! $mdi_window )
{ GUtil::demise( "MDI creation error: $^E\n" );
}

# label_bitmap inside MDI window

$label_bitmap = $mdi_window->AddLabel(
  -name => 'label_bitmap',
  -bitmap => 1,
  -left => 0, -top => 0, -width => $mwsw - 40, -height => $mwsh - 40,
  -tip => 'list display area',
  );

The interesting feature is that the label is automatically resized when you insert a different bitmap via later calles like

   $label_bitmap->SetImage ( $bitmap );

The size is taken from the $bitmap image content. But by being within an MDI window, scroll bars were automatically added to that window so that the whole bitmap could be viewed when it is bigger than the containing MDI window, and the scroll bars would go away when the bitmap was smaller than the containing MDI window. And no other code was needed to achieve it.

Probably I was using Win32::GUI::MDI for an inappropriate usage. This is all code that I wrote, and I am willing to rework it, but some ideas on how I should best do such a thing would be appreciated.

The basic goal is a scrollable, fixed size container for a dynamically sized bitmap. Showing it via a label is not particularly necessary, but that seems to be convenient.

One thing I didn't like about my above implementation is that I hadn't figured out how to control the scroll bars via API calls at all, to choose which part of the image was showing. The user could scroll at will, however.

I'm not sure whether the old Win32::GUI::MDI corresponds more directly to the new MDIFrame or the MDIClient, or whether one must always have an MDIClient and MDIChild inside an MDIFrame, or just can put a label directly into an MDIFrame....

I tried substituting MDIFrame for MDI in my code above, and got a surprising error:

Use of uninitialized value in substitution (s///) at GUI.pm line 1046.

After uncommenting the debugging print statement in AUTOLOAD, I discover that it is failing to autoload a method named "-name" on Win32::GUI::MDIFrame, but not sure why.

Well, I'll play a bit more, maybe you'll have some ideas of where I should look.


    It's work but one stuff don't work as expected :-(
    I have a trouble with menu identifer when try to add a window menu to
MDIClient.

This limit won't affect me, as I'm not using different menus for MDI windows.

    It's use 0 based identifier for window child menu item but not assigned
default MDIChild identifier.
    So, i have a conflict with standard menu item. Need to investigate ...

Laurent.

Changelog : Add MDI Window Support and Fix Tied property & Window
Destruction.
    - GUI.h :
        + Added new MDI Constants and Callback functions.
        + Added a dwData field in PERLWIN32GUI_USERDATA.
    - GUI.pm :
        + _new : Fix tied hash property.
        + Comment AUTOLOAD in Win32::GUI::Window : Is usefull ?
        + New Win32::GUI::MDIFrame, Win32::GUI::MDIClient,
Win32::GUI::MDIChild class.
        + Win32::GUI::WindowProps : Fix Destroy managing.
        + Register new class for MDI.
    - GUI.xs :
        + In GetKeyboardState : Use a stack array for key.
        + In RegisterClassEx :
            + Added MDIFrame, MDIClient, MDIChild widget option.
            + Avoid reccursive Window Msg Loop call.
        + In Create :
            + Use a weaken reference for perlpud->SvSelf for clean reference
count and memory free.
            + Added MDI support.
            + Added dwData field support.
        + In Change : Added MDI support.
        + In Dialog, DoEvents, DoModal : Added MDI event loop support.
        + LockWindowUpdate : Rewrite shorter.
    - GUI_Constants.cpp :
        + Added MDI class constants.
    - GUI_Helpers.cpp :
        + Addes MDI class callback.
        + Perlud_Free : Correct destruction problem.
    - GUI_MessageLoops.cpp :
        + In CommonMsgLoop : Don't manage WM_GETMINMAXINFO for MDI Child.
        + In WindowMsgLoop :
            + Added support for WndProc call.
            + For WM_DESTROY, call default MsgLoop before free perlud.
            + Handle WM_MDIACTIVATE & WM_SETFOCUS for MDI Window.
        + Added DefMDIFrameLoop and MDIFrameMsgLoop for MDIFrame Window.
        + Added MDIClientMsgLoop for MDICLient window.
        + Added DefMDIChildLoop and MDIChildMsgLoop for MDIChild Window.
    - GUI_Options.cpp :
        + In ParseWindowOptions : Added a missing else for class specific
option parsing.
    - Makefile.pl &  Makefile_m.pl : Add new MDI.xs file.
    - MDI.xs : Manage MDI window.
    - Window.xs : Remove MDI class and add MDI event documentation.
    - Samples\MDI.pl : New Sample form MDI use.
    - Docs\DoDoc.pl : Add new MDI.xs file.



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
Perl-Win32-GUI-Hackers mailing list
Perl-Win32-GUI-Hackers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-hackers




--
Glenn -- http://nevcal.com/
===========================
The best part about procrastination is that you are never bored,
because you have all kinds of things that you should be doing.


Reply via email to