Button a la derecha
Posted: Wed Jan 17, 2018 5:52 am
www.FiveTechSoft.com
https://forums.fivetechsoft.com/
Code: Select all
// 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
Code: Select all
DEFINE BUTTON oBtns6 OF oBarMain PROMPT "Salir" ;
FILE ".\imagenes\png\boton.png" BTNRIGHT FLAT
oBtns6:bAction := { || oWndMain:End() }
oBtns6:oCursor := oCursorHand
Code: Select all
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 }
............
............
BTNRIGHT clause is provided to display the button on the rightside of the bar.mag071 wrote:Saludos ;
Añadir la clausula BTNRIGHT y el botón se te pone como en la imagen.
Ejemplo.:Code: Select all
DEFINE BUTTON oBtns6 OF oBarMain PROMPT "Salir" ; FILE ".\imagenes\png\boton.png" BTNRIGHT FLAT oBtns6:bAction := { || oWndMain:End() } oBtns6:oCursor := oCursorHand