From: Laurent R. <ro...@cl...> - 2004-04-27 18:26:06
|
Hi, I remove Win32::GUI::MDI because it's current implementation not = realy permit to use it in an MDI application context.=20 I don't think anyone use this class ;o) And, i don't know this usage = too. I can restore old Win32::GUI::MDI class. But, this class name = probably confuse user for create MDI application. Win32::GUI::MDI use same window class than Win32::GUI::MDIClient. You can replace Win32::GUI::MDI with a Win32::GUI::MDIClient but = AddLablel method don't exist for this class.=20 It's only have a AddChild. And this class it's not same as a = Win32::GUI::Window like Win32::GUI::MDI. For compatibility, i think you can replace Win32::GUI::MDI by = something like that : $mdi_window =3D Win32::GUI::Window->new ( -remstyle =3D> WS_OVERLAPPEDWINDOW, -addstyle =3D> WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL = | WS_HSCROLL, -classname =3D> 'MDICLIENT', -name =3D> 'mdi_window', -parent =3D> $mw, -text =3D> 'MDI', -top =3D> 0, -left =3D> 0, -width =3D> $mwsw, -height =3D> $mwsh - 40, ); Laurent. > On approximately 4/26/2004 9:40 AM, came the following characters from > the keyboard of Laurent ROCHER: > > Hi All, > >=20 > > I commit new changes. > > - Window properties now re-work. >=20 > Good :) :) >=20 > > - 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). > >=20 > > For MDI, i have add a sample in Samples directory. >=20 > This sounds good, and looks good. Unfortunately, not compatible with=20 > old Win32::GUI::MDI. I wonder if there is any way to have the added=20 > functionality you are producing, and still be compatible with the old=20 > code. My old code was: >=20 > # MDI window >=20 > $mdi_window =3D Win32::GUI::MDI->new ( > -name =3D> 'mdi_window', > -parent =3D> $mw, > -text =3D> 'MDI', > -top =3D> 0, -left =3D> 0, > -width =3D> $mwsw, -height =3D> $mwsh - 40, > -visible =3D> 1, > ); > if ( ! $mdi_window ) > { GUtil::demise( "MDI creation error: $^E\n" ); > } >=20 > # label_bitmap inside MDI window >=20 > $label_bitmap =3D $mdi_window->AddLabel( > -name =3D> 'label_bitmap', > -bitmap =3D> 1, > -left =3D> 0, -top =3D> 0, -width =3D> $mwsw - 40, -height =3D> = $mwsh - 40, > -tip =3D> 'list display area', > ); >=20 > The interesting feature is that the label is automatically resized = when=20 > you insert a different bitmap via later calles like >=20 > $label_bitmap->SetImage ( $bitmap ); >=20 > 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=20 > that the whole bitmap could be viewed when it is bigger than the=20 > containing MDI window, and the scroll bars would go away when the = bitmap=20 > was smaller than the containing MDI window. And no other code was=20 > needed to achieve it. >=20 > 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=20 > on how I should best do such a thing would be appreciated. >=20 > The basic goal is a scrollable, fixed size container for a dynamically = > sized bitmap. Showing it via a label is not particularly necessary, = but=20 > that seems to be convenient. >=20 > 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=20 > choose which part of the image was showing. The user could scroll at=20 > will, however. >=20 > 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=20 > MDIClient and MDIChild inside an MDIFrame, or just can put a label=20 > directly into an MDIFrame.... >=20 > I tried substituting MDIFrame for MDI in my code above, and got a=20 > surprising error: >=20 > Use of uninitialized value in substitution (s///) at GUI.pm line 1046. >=20 > After uncommenting the debugging print statement in AUTOLOAD, I = discover=20 > that it is failing to autoload a method named "-name" on=20 > Win32::GUI::MDIFrame, but not sure why. >=20 > Well, I'll play a bit more, maybe you'll have some ideas of where I=20 > should look. >=20 |