From: Jez W. <je...@je...> - 2004-02-24 16:58:46
|
Hi, I would be grateful if someone could commit this change to the = InsertBand method of a rebar control. I've added the option "-style". Cheers, jez. = #########################################################################= ## # (@)METHOD:InsertBand(%OPTIONS) # # Insert a new band into the rebar control. # # Allowed %OPTIONS are: # # -image =3D> Zero based index of the imagelist. # -index =3D> Zero based index where the band is inserted. # -bitmap =3D> The background bitmap for the band. # -child =3D> Child control. See Below. # -foreground =3D> Band foreground colors. # -background =3D> Band background colors. # -width =3D> The width of the band. # -minwidth =3D> The minimum width of the band. # -minheight =3D> The minimum height of the band. # -text =3D> The text for the band. # -style =3D> The style of the band. See Below # # Each band can only contain one child control. However, you can add = a child window that contains many controls: # # $mainwindow =3D <main window code> # # my $band =3D new Win32::GUI::Window ( # -parent =3D> $mainwindow, # -name =3D> "RebarBand1", # -popstyle =3D> WS_CAPTION | WS_SIZEBOX, # -pushstyle =3D> WS_CHILD, # ); # # # create Date time control for band 1 # my $DateTime =3D $band->AddDateTime ( # -name =3D> "DateTime", # -pos =3D> [0, 0], # -size =3D> [130, 20], # -tip =3D> 'A date and time', # ); # #set the format for the datetime control # $DateTime->Format('dd-MMM-yyyy HH:mm:ss'); # # #Add a button to band 1 # $band->AddButton ( # -name =3D> 'Button', # -pos =3D> [135, 0], # -size =3D> [50, 20], # -text =3D> 'Button', # -tip =3D> 'A Button', # -onClick =3D> sub {print 'button clicked' }, # ); # # my $rebar =3D $mainwindow->AddRebar( # -name =3D> "Rebar", # -bandborders =3D> 1, # ); # # #Insert band # $rebar->InsertBand ( =20 # -child =3D> $band, # -width =3D> 210, # -minwidth =3D> 210, # -minheight =3D> 20, # ); # # Styles # # Each band can have it's own style. As a default, each band has = RBBS_CHILDEDGE | RBBS_FIXEDBMP # RBBS_BREAK 1 The band is on a new line. # RBBS_FIXEDSIZE 2 The band can't be sized. With this style, the = sizing grip is not displayed on the band. # RBBS_CHILDEDGE 4 The band has an edge at the top and bottom of the = child window. # RBBS_HIDDEN 8 The band will not be visible. # RBBS_FIXEDBMP 32 The background bitmap does not move when the band = is resized. # RBBS_VARIABLEHEIGHT 64 The band can be resized by the rebar = control. # RBBS_GRIPPERALWAYS 128 The band will always have a sizing grip, = even if it is the only band in the rebar. # RBBS_NOGRIPPER 256 The band will never have a sizing grip, even if = there is more than one band in the rebar. # LRESULT InsertBand(handle,...) HWND handle PREINIT: REBARBANDINFO rbbi; int i, next_i; UINT index; CODE: ZeroMemory(&rbbi, sizeof(REBARBANDINFO)); rbbi.cbSize =3D sizeof(REBARBANDINFO); rbbi.fStyle =3D RBBS_CHILDEDGE | RBBS_FIXEDBMP; SwitchBit(rbbi.fMask, RBBIM_STYLE, 1); index =3D (UINT) -1; next_i =3D -1; for(i =3D 1; i < items; i++) { if(next_i =3D=3D -1) { if(strcmp(SvPV_nolen(ST(i)), "-image") =3D=3D 0) { next_i =3D i + 1; rbbi.iImage =3D SvIV(ST(next_i)); SwitchBit(rbbi.fMask, RBBIM_IMAGE, 1); } else if(strcmp(SvPV_nolen(ST(i)), "-index") =3D=3D 0) { next_i =3D i + 1; index =3D (UINT) SvIV(ST(next_i)); } else if(strcmp(SvPV_nolen(ST(i)), "-bitmap") =3D=3D 0) { next_i =3D i + 1; rbbi.hbmBack =3D (HBITMAP) handle_From(NOTXSCALL = ST(next_i)); SwitchBit(rbbi.fMask, RBBIM_BACKGROUND, 1); } else if(strcmp(SvPV_nolen(ST(i)), "-child") =3D=3D 0) { next_i =3D i + 1; rbbi.hwndChild =3D (HWND) handle_From(NOTXSCALL = ST(next_i)); SwitchBit(rbbi.fMask, RBBIM_CHILD, 1); } else if(strcmp(SvPV_nolen(ST(i)), "-foreground") =3D=3D 0) = { next_i =3D i + 1; rbbi.clrFore =3D SvCOLORREF(NOTXSCALL ST(next_i)); SwitchBit(rbbi.fMask, RBBIM_COLORS, 1); } else if(strcmp(SvPV_nolen(ST(i)), "-background") =3D=3D 0) = { next_i =3D i + 1; rbbi.clrBack =3D SvCOLORREF(NOTXSCALL ST(next_i)); SwitchBit(rbbi.fMask, RBBIM_COLORS, 1); } else if(strcmp(SvPV_nolen(ST(i)), "-width") =3D=3D 0) { next_i =3D i + 1; rbbi.cx =3D SvIV(ST(next_i)); SwitchBit(rbbi.fMask, RBBIM_SIZE, 1); } else if(strcmp(SvPV_nolen(ST(i)), "-minwidth") =3D=3D 0) { next_i =3D i + 1; rbbi.cxMinChild =3D SvIV(ST(next_i)); SwitchBit(rbbi.fMask, RBBIM_CHILDSIZE, 1); } else if(strcmp(SvPV_nolen(ST(i)), "-minheight") =3D=3D 0) = { next_i =3D i + 1; rbbi.cyMinChild =3D SvIV(ST(next_i)); SwitchBit(rbbi.fMask, RBBIM_CHILDSIZE, 1); } else if(strcmp(SvPV_nolen(ST(i)), "-text") =3D=3D 0) { next_i =3D i + 1; rbbi.lpText =3D SvPV_nolen(ST(next_i)); SwitchBit(rbbi.fMask, RBBIM_TEXT, 1); } else if(strcmp(SvPV_nolen(ST(i)), "-style") =3D=3D 0) { next_i =3D i + 1; rbbi.fStyle =3D SvIV(ST(next_i)); } } else { next_i =3D -1; } } RETVAL =3D SendMessage(handle, RB_INSERTBAND, (WPARAM) index, = (LPARAM) &rbbi); OUTPUT: RETVAL |