Arh. I understand now.

The -bitmap option is used to paint the background of a band, not for
specifying a bitmap/button control.

jez.
----- Original Message ----- 
From: "Chris Wearn" <[EMAIL PROTECTED]>
To: "Jez White" <[EMAIL PROTECTED]>
Cc: "Win32-GUI List" <perl-win32-gui-users@lists.sourceforge.net>
Sent: Friday, January 23, 2004 4:24 PM
Subject: RE: Rebar - InsertBands - MultipleButtons


> Hi Jez,
>
> Hmmm, sort of. Again, if I go back to the Outlook example and you look at
> the rebar... if you move the mouse over the 'Reply' button, it has a
little
> picture followed by the word 'Reply' all atop the button. The only way I
can
> get this to work is to create the bitmap as containing an both the piccy
of
> the man and the word Reply, rather than have attributes as expected:
>
> -text   => "reply",
> -bitmap => $piccy_of_man,
>
> Chris
>
> > -----Original Message-----
> > From: Jez White [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, 24 January 2004 12:08 AM
> > To: Chris Wearn
> > Cc: Win32-GUI List
> > Subject: Re: Rebar - InsertBands - MultipleButtons
> >
> >
> > Hi,
> >
> > Not sure why you had to declare $band2 like that - my dodgy code eh?:)
> >
> > I'm not sure what you mean when you talk about "image (bitmap) to
contain
> > both the leading...", if you are talking about the rebar band and it's
> > options, then the following may help:
> >
> >     # (@)METHOD:InsertBand(%OPTIONS)
> >     #
> >     # Insert a new band into the rebar control.
> >     #
> >     # Allowed %OPTIONS are:
> >     #
> >     # -image      => Zero based index of the imagelist.
> >     # -index      => Zero based index where the band is inserted.
> >     # -bitmap     => The background bitmap for the band.
> >     # -child      => Child control. See Below.
> >     # -foreground => Band foreground colors.
> >     # -background => Band background colors.
> >     # -width      => The width of the band.
> >     # -minwidth   => The minimum width of the band.
> >     # -minheight  => The minimum height of the band.
> >     # -text       => The text for the band.
> >
> > If you are talking about normal buttons with an image in it and text - I
> > haven't got a clue:) I know toolbars can do this - but we're
> > still left with
> > the problem of attaching them to the rebar. You could go for the ugly
hack
> > where you have a button containing a bitmap with a text label
underneath.
> >
> > cheers,
> >
> > jez.
> >
> > ----- Original Message -----
> > From: "Chris Wearn" <[EMAIL PROTECTED]>
> > To: "Jez White" <[EMAIL PROTECTED]>
> > Cc: "Win32-GUI List" <perl-win32-gui-users@lists.sourceforge.net>
> > Sent: Friday, January 23, 2004 3:55 PM
> > Subject: RE: Rebar - InsertBands - MultipleButtons
> >
> >
> > > Hi Jez,
> > >
> > > Hey works for me... interestingly I had to beat it into submission a
bit
> > > (didn't like the 'my' on $band2 and then had to declare $band2 as:
> > >
> > > use vars qw(
> > > $band2
> > > );
> > >
> > > Visually the example creates the same capabilities as that of
> > the Outlook
> > > example (despite the fact that it may not be strictly the correct way
of
> > > doing it).
> > >
> > > Have you found a way of getting text and an image on a button? Or am I
> > write
> > > in assuming that it requires the image (bitmap) to contain both the
> > leading
> > > image and trailing text.
> > >
> > > Chris
> > >
> > > > -----Original Message-----
> > > > From: Jez White [mailto:[EMAIL PROTECTED]
> > > > Sent: Friday, 23 January 2004 11:13 PM
> > > > To: Chris Wearn; Win32-GUI List
> > > > Subject: Re: [perl-win32-gui-users] Rebar - InsertBands -
> > > > MultipleButtons
> > > >
> > > >
> > > > Hi,
> > > >
> > > > Some good news and some bad news...
> > > >
> > > > The bad. To me the outlook rebar control looks like it contains a
> > toolbar
> > > > which contains the icons/text and separators. I have yet to get a
> > > > toolbar to
> > > > work correctly with the rebar...The toolbar control itself has
various
> > > > methods/features missing (hottrack and separators amongst others).
> > > >
> > > > The Good. You can only have one control per band - however,
> > you can add
> > as
> > > > many controls to a child window, which can then be added to a rebar
> > band.
> > > > The example below shows this in action.
> > > >
> > > > I've also added some new documentation to rebar.xs (as well
> > as adding a
> > > > couple of methods ShowBand and HideBand) and created a tracker
> > > > item for some
> > > > of the issues - feel free to add issues to that tracker item.
> > > > There is also
> > > > a tracker item for the toolbar issues.
> > > >
> > > > http://sourceforge.net/tracker/?group_id=16572
> > > >
> > > > Cheers,
> > > >
> > > > jez.
> > > >
> > > >
> > > > ==============
> > > > This example creates 3 bands, band one is empty. Band 2 contains
> > > > a couple of
> > > > drop downs, while band 3 contains a datetime control and a couple of
> > > > buttons.
> > > >
> > > >
> > > > use Win32::GUI;
> > > > use strict;
> > > >
> > > > #create the main window
> > > > my $mainwindow = new GUI::Window(
> > > >     -title    => "Win32::GUI::Rebar test",
> > > >     -left     => 100,
> > > >     -top      => 100,
> > > >     -width    => 600,
> > > >     -height   => 200,
> > > >     -name     => "Window",
> > > >     -onTerminate => sub { return -1 },
> > > > );
> > > >
> > > > #create a child window for band 2 of the rebar control, this band
will
> > > > contain two dropdowns
> > > > my $band2 = new Win32::GUI::Window (
> > > >     -parent    => $mainwindow,
> > > >     -name      => "RebarBand2",
> > > >     -popstyle  => WS_CAPTION | WS_SIZEBOX,
> > > >     -pushstyle => WS_CHILD,
> > > > );
> > > >
> > > > #create the first drop down
> > > > my $dd1 = $band2->AddCombobox(
> > > >     -name      => "Dropdown",
> > > >     -pos       => [0, 0],
> > > >     -size      => [100, 80],
> > > >     -addstyle  =>  3 | 2097152  | 1048576,
> > > >     -tip       => 'Some items',
> > > > );
> > > >
> > > > $dd1->Add('Item 1','Item 2','Item 3','Item4');
> > > > $dd1->Select(0);
> > > >
> > > > #create the second drop down
> > > > my $dd2 = $band2->AddCombobox(
> > > >     -name   => "Dropdown2",
> > > >     -pos    => [105, 0],
> > > >     -size   => [100, 80],
> > > >     -addstyle  =>  3 | 2097152  | 1048576,
> > > >     -tip       => 'Some colours',
> > > > );
> > > >
> > > > $dd2->Add('Red','Blue','Green');
> > > > $dd2->Select(0);
> > > >
> > > > #create a child window for band 3 of the rebar control
> > > > my $band3 = new Win32::GUI::Window (
> > > >     -parent   => $mainwindow,
> > > >     -name     => "RebarBand3",
> > > >     -popstyle => WS_CAPTION | WS_SIZEBOX,
> > > >     -pushstyle => WS_CHILD,
> > > > );
> > > >
> > > > # create Date time control for band 3
> > > > my $DateTime = $band3->AddDateTime (
> > > >     -name     => "DateTime",
> > > >     -pos      => [0, 0],
> > > >     -size     => [130, 20],
> > > >     -tip      => 'A date and time',
> > > > );
> > > > #set the format for the datetime control
> > > > $DateTime->Format('dd-MMM-yyyy HH:mm:ss');
> > > >
> > > > #Add a button to band 3
> > > > $band3->AddButton (
> > > >          -name     => 'Button',
> > > >          -pos      => [135, 0],
> > > >          -size     => [50, 20],
> > > >          -text     => 'Button',
> > > >          -tip      => 'A Button',
> > > >          -onClick => sub {print 'button clicked' },
> > > > );
> > > >
> > > > #Add a button to band 3
> > > > $band3->AddButton (
> > > >          -name     => 'Button1',
> > > >          -pos      => [195, 0],
> > > >          -size     => [50, 20],
> > > >          -text     => 'Button1',
> > > >          -tip      => 'A Button',
> > > >          -onClick => sub {print 'button1 clicked' },
> > > > );
> > > >
> > > > #create a rebar control
> > > > my $rebar;
> > > > $rebar = $mainwindow->AddRebar(
> > > >     -name   => "Rebar",
> > > >     -bandborders => 1,
> > > >     -fixedorder  => 1,
> > > >     -onHeightChange => sub {print
> > 'Rebar_HeightChange'.$rebar->Height;},
> > > > );
> > > >
> > > > #Insert band 1
> > > > $rebar->InsertBand (-text => 'One' );
> > > > #Insert band 2
> > > > $rebar->InsertBand (
> > > >   -child     => $band2,
> > > >   -width     => 210,
> > > >   -minwidth  => 210,
> > > >   -minheight => 21,
> > > > );
> > > > #Insert band 3
> > > > $rebar->InsertBand (
> > > >   -child     => $band3,
> > > >   -width     => 250,
> > > >   -minwidth  => 250,
> > > >   -minheight => 21,
> > > > );
> > > >
> > > > #show the main window
> > > >
> > > > $mainwindow->Show;
> > > >
> > > > Win32::GUI::Dialog;
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Chris Wearn" <[EMAIL PROTECTED]>
> > > > To: "Win32-GUI List" <perl-win32-gui-users@lists.sourceforge.net>
> > > > Sent: Friday, January 23, 2004 2:50 PM
> > > > Subject: [perl-win32-gui-users] Rebar - InsertBands -
MultipleButtons
> > > >
> > > >
> > > > > Hi All,
> > > > >
> > > > > I'm still messing around with rebar, trying to create a menu
similar
> > to
> > > > the
> > > > > rebar in say 'Outlook'. Where a single Band contains a number of
> > buttons
> > > > and
> > > > > seperators:  | [Reply] [Reply To All] [Forward] |
> > [Send/Receive]| etc
> > > > >
> > > > > After more tinkering, I've discovered that the button wont
> > > > accept a -text
> > > > > attribute and -bitmap (in that the text wont be rendered). So
> > > > if you want
> > > > a
> > > > > bitmap leading the text, you need to create the bitmap with the
> > > > image and
> > > > > the text and put the whole lot on the button.
> > > > >
> > > > > What I can't figure is how using -child you get more than one
button
> > or
> > > > > control per Band, or is this not possible.
> > > > >
> > > > > Chris
> > > > >
> > > > >
> > > > >
> > > > > -------------------------------------------------------
> > > > > The SF.Net email is sponsored by EclipseCon 2004
> > > > > Premiere Conference on Open Tools Development and Integration
> > > > > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> > > > > http://www.eclipsecon.org/osdn
> > > > > _______________________________________________
> > > > > Perl-Win32-GUI-Users mailing list
> > > > > Perl-Win32-GUI-Users@lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> > > >
> > >
> >
>


Reply via email to