FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Button a la derecha
Posts: 1054
Joined: Sun Oct 09, 2005 10:41 PM
Button a la derecha
Posted: Wed Jan 17, 2018 05: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
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Button a la derecha
Posted: Wed Jan 17, 2018 11:33 AM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Button a la derecha
Posted: Wed Jan 17, 2018 12:10 PM
Code (fw): Select all Collapse
// 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




Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 140
Joined: Thu Feb 02, 2006 12:09 PM
Re: Button a la derecha
Posted: Wed Jan 17, 2018 02:40 PM
Saludos ;
Añadir la clausula BTNRIGHT y el botón se te pone como en la imagen.

Ejemplo.:
Code (fw): Select all Collapse
         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
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Button a la derecha
Posted: Wed Jan 17, 2018 03:31 PM
Willi

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

Rick Lipkin

Code (fw): Select all Collapse
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  }

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


Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Button a la derecha
Posted: Thu Jan 18, 2018 01:53 AM
mag071 wrote:Saludos ;
Añadir la clausula BTNRIGHT y el botón se te pone como en la imagen.

Ejemplo.:
Code (fw): Select all Collapse
         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
Posts: 1054
Joined: Sun Oct 09, 2005 10:41 PM
Re: Button a la derecha
Posted: Thu Jan 18, 2018 04:59 PM

Gracias nageswaragunupudi, la cláusula BTNRIGHT FLAT funcionó perfectamente

:D

Posts: 537
Joined: Mon Jan 16, 2006 03:42 PM
Re: Button a la derecha
Posted: Fri Jan 19, 2018 07: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

Continue the discussion