Button a la derecha

Button a la derecha

Postby Willi Quintana » Wed Jan 17, 2018 5:52 am

Hola Amigos,
Usualmente, luego de definir una barra de botones (BUTTONBAR) en la ventana principal, luego defino los botones (BUTTON), y éstos empiezan por la izquierda hacia la derecha.
Ahora, como haría para tener un BUTTON al lado derecho la barra de botónes ?
Gracias
Image
User avatar
Willi Quintana
 
Posts: 1022
Joined: Sun Oct 09, 2005 10:41 pm
Location: Cusco - Perú

Re: Button a la derecha

Postby karinha » Wed Jan 17, 2018 11:33 am

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Button a la derecha

Postby karinha » Wed Jan 17, 2018 12:10 pm

Code: Select all  Expand view  RUN

// C:\FWH..\SAMPLES\TESTBTNL.PRG

#include "Fivewin.ch"

PROCEDURE MAIN()

   Local oFont, oWnd, oBar, b1, b2, b3, b4, b5

   DEFINE FONT oFont NAME "MS Sans Serif" SIZE 0,-10

   DEFINE WINDOW oWnd FROM 0,0 TO 474,639 PIXEL TITLE "Test"

   oWnd:SetFont(oFont)

   DEFINE BUTTONBAR oBar TOP _3D SIZE 80,80 OF oWnd

   DEFINE BUTTON RESOURCE "TOP"     TOP    PROMPT "Top"    NOBORDER OF oBar
   DEFINE BUTTON RESOURCE "LEFT"    LEFT   PROMPT "Left"   NOBORDER OF oBar
   DEFINE BUTTON RESOURCE "BOTTOM"  BOTTOM PROMPT "Bottom" NOBORDER OF oBar
   DEFINE BUTTON RESOURCE "RIGHT"   RIGHT  PROMPT "Right"  NOBORDER OF oBar
   DEFINE BUTTON RESOURCE "CENTER"  CENTER PROMPT "Center" NOBORDER OF oBar

   @10,500 BTNBMP RESOURCE "TOP"    TOP    PROMPT "DERECHA"    SIZE 70,70 OF oBar

   // @100,100 BTNBMP RESOURCE "TOP"    TOP    PROMPT "Top"    SIZE 80,80 OF oWnd

   /*
   @180, 20 BTNBMP RESOURCE "LEFT"   LEFT   PROMPT "Left"   SIZE 80,80 OF oWnd
   @260,100 BTNBMP RESOURCE "BOTTOM" BOTTOM PROMPT "Bottom" SIZE 80,80 OF oWnd
   @180,180 BTNBMP RESOURCE "RIGHT"  RIGHT  PROMPT "Right"  SIZE 80,80 OF oWnd
   @180,100 BTNBMP RESOURCE "CENTER" CENTER PROMPT "Center" SIZE 80,80 OF oWnd

   @100,400 BTNBMP b1 RESOURCE "TOP","","TOP0"       TOP    PROMPT "Top"    SIZE 80,80 OF oWnd
   @180,320 BTNBMP b2 RESOURCE "LEFT","","LEFT0"     LEFT   PROMPT "Left"   SIZE 80,80 OF oWnd
   @260,400 BTNBMP b3 RESOURCE "BOTTOM","","BOTTOM0" BOTTOM PROMPT "Bottom" SIZE 80,80 OF oWnd
   @180,480 BTNBMP b4 RESOURCE "RIGHT","","RIGHT0"   RIGHT  PROMPT "Right"  SIZE 80,80 OF oWnd
   @180,400 BTNBMP b5 RESOURCE "CENTER","","CENTER0" CENTER PROMPT "Center" SIZE 80,80 OF oWnd

   b1:Disable()
   b2:Disable()
   b3:Disable()
   b4:Disable()
   b5:Disable()
   */


   DEFINE MSGBAR OF oWnd PROMPT "Testing bitmaped buttons with captions" ;
      TIME DATE NOINSET

   ACTIVATE WINDOW oWnd

RETURN

procedure AppSys  // Xbase++ requirement

return
 


Image

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Button a la derecha

Postby mag071 » Wed Jan 17, 2018 2:40 pm

Saludos ;
Añadir la clausula BTNRIGHT y el botón se te pone como en la imagen.

Ejemplo.:
Code: Select all  Expand view  RUN

         DEFINE BUTTON oBtns6 OF oBarMain PROMPT "Salir" ;
         FILE ".\imagenes\png\boton.png" BTNRIGHT FLAT
         oBtns6:bAction := { || oWndMain:End() }
         oBtns6:oCursor := oCursorHand
 
Mario Antonio González Osal
Venezuela
m a g 0 7 1 @ g m a i l. c o m
User avatar
mag071
 
Posts: 140
Joined: Thu Feb 02, 2006 12:09 pm
Location: Venezuela

Re: Button a la derecha

Postby Rick Lipkin » Wed Jan 17, 2018 3:31 pm

Willi

I just create 'blank' buttons to add fill to my button bar .. Consider this code..

Rick Lipkin

Code: Select all  Expand view  RUN

DEFINE BUTTONBAR oBar OF oWind SIZE 80,64 2010
       oBar:SetColor( 0)                   // 45,40

   oBar:bClrGrad = { || { { 0.10,15724527,7303023 }, ;       // grey
       { 0.10,7303023,15724527 } } }

       DEFINE BUTTON oButt1 of oBar ACTION ( _CustOpen( "A",oWind ))  ;
              RESOURCE "customer" PROMPT "Clients-Billing" TOOLTIP "Clients and Billing"

       DEFINE BUTTON oButt2 of oBar ACTION (_Arview( "A",oWind )) ;
              RESOURCE "payment"     PROMPT "Receivables" TOOLTIP "Review Receivables"+CRLF+"Customer Statements"
                        // review //

       DEFINE BUTTON oButt3 of oBar ACTION ( _PayView( "A",oWind )) ;
              RESOURCE "cash"        PROMPT "Payments"    TOOLTIP "Payments and Adjustments"

       *   DEFINE BUTTON oButt4 of oBar ACTION nil
       *   DEFINE BUTTON oButt5 of oBar ACTION nil

       DEFINE BUTTON oButt7  of oBar ACTION ( nil )  // hide this ;
       DEFINE BUTTON oButt8  of oBar ACTION ( nil )  // hide this

       //--------  group --
       MENU oPopRpt POPUP
            MENUITEM "Customer Reports"  //RESOURCE "billing" ;
               MENU
               MENUITEM "Customer Listing Report" ACTION ( _CustList() )
               MENUITEM "Customer History Report" ACTION ( _CustHist() )
               MENUITEM "Customer Advertising and Publishing Report" ACTION ( _PubRpt() )
               ENDMENU
            MENUITEM "Accounts Receivable Reports"  //FileName (cDefa+"\Icons\FOLDERCLOSED.bmp");
               MENU
               MENUITEM "Customer Balance and Ageing Report" ACTION ( _ArAgeing())
               ENDMENU
            MENUITEM "Payment Reports"  // FileName (cDefa+"\Icons\FOLDERDETAIL.bmp");
               MENU
               MENUITEM "Payments and Adjustments Report" ACTION ( _PaymtRpt() )
               MENUITEM "Customer Pre-Payment Balances  " ACTION ( _PrePay() )
               ENDMENU
       ENDMENU

       DEFINE BUTTON oButt9 of oBar RESOURCE "report" ;
       MESSAGE "Reports" ;
       ACTION oButt9:ShowPopup();
       PROMPT "Reports" GROUP ;
       MENU oPopRpt
       oButt9:cToolTip := { " " + CRLF + "Reports", "Customer, Acct Rec and Payment Reports", 1, CLR_BLACK, 14089979  }

     ............
     ............
 


Image
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Button a la derecha

Postby nageswaragunupudi » Thu Jan 18, 2018 1:53 am

mag071 wrote:Saludos ;
Añadir la clausula BTNRIGHT y el botón se te pone como en la imagen.

Ejemplo.:
Code: Select all  Expand view  RUN

         DEFINE BUTTON oBtns6 OF oBarMain PROMPT "Salir" ;
         FILE ".\imagenes\png\boton.png" BTNRIGHT FLAT
         oBtns6:bAction := { || oWndMain:End() }
         oBtns6:oCursor := oCursorHand
 

BTNRIGHT clause is provided to display the button on the rightside of the bar.
FWH recommends use of BTNRIGHT clause.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Button a la derecha

Postby Willi Quintana » Thu Jan 18, 2018 4:59 pm

Gracias nageswaragunupudi, la cláusula BTNRIGHT FLAT funcionó perfectamente
:D
User avatar
Willi Quintana
 
Posts: 1022
Joined: Sun Oct 09, 2005 10:41 pm
Location: Cusco - Perú

Re: Button a la derecha

Postby jbrita » Fri Jan 19, 2018 7:06 pm

aca va otra.
DEFINE BUTTON oBtns[12] OF oBar RESOURCE "BAR_AYU" ;
TOOLTIP "Ayuda," + CRLF + "Indice y Contenido";
NOBORDER


oVentPrinc:bResized:={|| oBtns[12]:Move(2,oVentPrinc:nWidth()-35)}


Saludos
jbrita
 
Posts: 502
Joined: Mon Jan 16, 2006 3:42 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], wmormar and 63 guests