Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Clipper Visual-Objects > Re: SLE button ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 7 Topic 11319 of 11631
Post > Topic >>

Re: SLE button example

by "Willie Moore" <williem@[EMAIL PROTECTED] > Apr 18, 2008 at 04:53 PM

Jorge,

The SLEButton is just a subclass of wmNewBitMapButton. The =
wmNewBitMapButton is a class that inherits from the VO Pushbutton class. =
I added 2 methods to handle the assinging of a image via bitmap or icon.

A SLEButton is attached to the SLE during the AssignImage method. The =
SLE contains a reference to a pushbutton. When you assign an image, the =
SLE will create the bitmap button and then assign the image to it.

I wont post the=20

Regards,

Willie

CLASS pbCalcSlE INHERIT CalcSLE
METHOD init(oOwner, nId, oPoint, oDim, kStyle,lDataAware ) CLASS =
pbCalcSLE
 SUPER:init( oOwner, nID, oPoint, oDim, kStyle, lDataAware )
 SELF:AssignImage("rsle_calcup")                                         =
               // this is the line that causes the SLE to add a button
 RETURN SELF

CLASS rightSLE INHERIT SingleLineEdit
     PROTECT oPB       AS OBJECT                                         =
       // this is the pushbutton container
METHOD AssignImage(xImage AS STRING) AS VOID PASCAL CLASS RightSLE
     // I have cut out the nonrelavant code (ie the old button parts)
     LOCAL oPoint    AS Point
     LOCAL oDim     AS Dimension
     LOCAL cBaseName  AS STRING           =20
     LOCAL nOldAlignment AS LONG

   //Copy the position and size of the current SLE
    oPoint :=3D Point{ SELF:Origin:X , SELF:Origin:Y }
    oDim   :=3D Dimension{ SELF:size:width , SELF:size:height}
    =20
     // =
*************************************************************************=
****
     // * if we are using owner alignments, we must save the currenyt =
alignment and *
     // * then get id of it before we create the button or you will not =
be able     *
     // * to move the button once it is created                          =
           *
     // =
*************************************************************************=
****
      nOldAlignment   :=3D SELF:nOwneralignment          =20
     IF nOldAlignment <> OA_NO
         SELF:Owneralignment :=3D OA_NO
     ENDIF

      oPoint:y  -=3D 1        // Put the button one pixel up from SLE =
position
      oPoint:x  :=3D oPoint:x + oDim:width  // put the button at the end =
of the SLE
      oDim:width  :=3D 33       // have a default size of 33
      oDim:height +=3D 1
 =20
      SELF:oPB :=3D SLEButton{SELF:Owner,-1,oPoint,oDim,SELF}

      IF SELF:lUseResourcesforIcons
           SELF:oPB:UseResource :=3D TRUE
      ENDIF

      IF SELF:symImageType =3D #BITMAP
           SELF:oPB:AssignBitmap(xImage)
      ELSE
          SELF:oPB:AssignIcon(xImage)
      ENDIF

      //Reset the width for the button based on image width
      oDim:width :=3D SELF:oPB:Image:Size:Width + 8

      //Adjust the placement of the button
      oPoint:x :=3D oPoint:x - oDim:width
      SELF:oPB:Origin :=3D oPoint

      //Reset button width based on image width
      SELF:oPB:Size :=3D oDim

      //Reduce the length of the SLE to accommodate the button
      =
SetWindowPos(SELF:handle(),0L,0,0,SELF:size:width-oDim:Width,SELF:size:he=
ight,SWP_NOMOVE+0x14)

     // =
*******************************************************************
     // * wcm 2008-03-27                                                 =
 *
     //  * now that the button has beenc reated, we must apply the       =
  *
     //  * owner alignment. This call works on the control plus the =
button *
     //  =
*******************************************************************
     IF nOldAlignment <> OA_NO
          SELF:Owneralignment  :=3D nOldAlignment=20
     ENDIF

     SELF:showpb()
     RETURN

METHOD Showpb() CLASS rightSLE
     IF SELF:oPB <> NULL_OBJECT
          IF SELF:IsVisible()
               SELF:oPB:show()
          ENDIF
          IF SELF:ReadOnly .OR. !IsWindowEnabled(SELF:handle())
               SELF:oPB:disable()
          ENDIF
     ENDIF
     RETURN NIL






<jorgeaccinelli@[EMAIL PROTECTED]
> wrote in message =
news:42fd9593-6930-43da-a544-f6ead284f0ec@[EMAIL PROTECTED]
 17 abr, 18:52, "Willie Moore" <will...@[EMAIL PROTECTED]
> wrote:
> Jorge,
>
> What info do you need? I will be happy to assist.
>
> Regards,
>
> Willie
>
> <jorgeaccine...@[EMAIL PROTECTED]
> wrote in =
messagenews:79261769-62e1-4f9e-a828-83dce781123e@[EMAIL PROTECTED]
>
> On 17 abr, 04:18, "Geoff Schaller" <geo...@[EMAIL PROTECTED]
>
> wrote:
>
>
>
>
>
> > Jorge.
>
> > What's wrong with the rightsle sample itself?
> > It uses SLEButton already.
>
> > Check the sample Willie provides.
>
> > Geoff
>
> > =
"jorgeaccine...@[EMAIL PROTECTED]
"<jorgeaccine...@[EMAIL PROTECTED]
> wrote in message
>
> =
>news:3967b509-c533-4f3e-92a0-d11ad90aec1e@[EMAIL PROTECTED]
>
> > > Hello
>
> > > Someone has an example on sle button?
> > > (RightSle class) I fail to see
> > > how it works
>
> > > Thanks
> > > Jorge Accinelli- Ocultar texto de la cita -
>
> > - Mostrar texto de la cita -
>
> There are several examples, but
> I could not find anything about
> "CLASS SLEButton INHERIT wmNewBitmapButton"
>
> Jorge- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -


I would like to see some example/s about
SleButton / wmNewBitmapButton  and how to relation****p
with bitmap buton


Jorge
 




 7 Posts in Topic:
SLE button example
jorgeaccinelli@[EMAIL PRO  2008-04-16 20:32:19 
Re: SLE button example
"Geoff Schaller"  2008-04-17 07:18:56 
Re: SLE button example
jorgeaccinelli@[EMAIL PRO  2008-04-17 06:44:50 
Re: SLE button example
"Willie Moore"   2008-04-17 16:52:49 
Re: SLE button example
"richard.townsendros  2008-04-18 03:09:43 
Re: SLE button example
jorgeaccinelli@[EMAIL PRO  2008-04-18 07:22:41 
Re: SLE button example
"Willie Moore"   2008-04-18 16:53:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 8:16:35 CDT 2008.