Page 1 of 1
ButtonBar in a specific location ( Solved )
Posted: Mon Mar 30, 2020 2:28 pm
by ctoas
Friends...
How to create a ButtonBar in a specific location in the Window?
The wiki shows:
@ <nRow>, <nCol> BUTTONBAR [<oBar>];
[SIZE <nWidth>, <nHeight>];
[BUTTONSIZE <nBtnWidth>, <nBtnHeight>];
[3D | 3DLOOK | _3D | _3DLOOK];
[TOP | LEFT | RIGHT | BOTTOM | FLOAT];
[OF | WINDOW | DIALOG <oWnd>];
[CURSOR <oCursor>]
But give the following error in the compilation:
Error E0022 Invalid lvalue: 'Numeric'
Can anyone help?
Thanks!
Re: ButtonBar in a specific location
Posted: Mon Mar 30, 2020 2:56 pm
by cnavarro
Please put little sample for tests
Re: ButtonBar in a specific location
Posted: Mon Mar 30, 2020 3:07 pm
by ctoas
Thanks for responding C. Navarro
I need to place the ButtonBar below the Title:
Code: Select all
DEFINE WINDOW oWndAGENDA FROM 0,0 TO 600,1041 PIXEL TITLE "GAM - AGENDA DE CONTATOS" COLORS nRGB(215,243,366),nRGB(215,215,215) NO MAXIMIZE
@ 0000,0000 TITLE oTitle OF oWndAGENDA SIZE 1025,0059 NOBORDER PIXEL
oTitle:aGrdBack := {{1,nRGB(150,150,150),nRGB(150,150,150)}}
oTitle:nShadow := 0
@ 0010,0020 TITLEIMG OF oTitle BITMAP "TIT_AGENDA" SIZE 0052,0052
@ 0015,0120 TITLETEXT OF oTitle TEXT "Agenda Telefônica" COLOR nRGB(255,255,255) FONT ARIAL14B
@ 0040,0120 TITLETEXT OF oTitle TEXT "CONTATOS" COLOR nRGB(000,000,000) FONT ARIAL16B
DEFINE BUTTONBAR oBarAGENDA 3DLOOK OF oWndAGENDA 2015 SIZE 0078,0078
DEFINE BUTTON oBtnADICIONAR RESOURCE "BAR_DLG_ADICIONAR" OF oBarAGENDA PROMPT "Adicionar" FONT ARIAL14B
DEFINE BUTTON oBtnVISUALIZAR RESOURCE "BAR_DLG_VISUALIZAR" OF oBarAGENDA PROMPT "Visualizar" FONT ARIAL14B
DEFINE BUTTON oBtnALTERAR RESOURCE "BAR_DLG_EDITAR" OF oBarAGENDA PROMPT "Editar" FONT ARIAL14B
DEFINE BUTTON oBtnEXCLUIR RESOURCE "BAR_DLG_EXCLUIR" OF oBarAGENDA PROMPT "Excluir" FONT ARIAL14B
DEFINE BUTTON oBtnRELATORIOS RESOURCE "BAR_DLG_RELATORIOS" OF oBarAGENDA PROMPT "Relatórios" GROUP FONT ARIAL14B
DEFINE BUTTON oBtnSAIR RESOURCE "BAR_DLG_SAIR" OF oBarAGENDA PROMPT "Sair" GROUP FONT ARIAL14B
oBarAGENDA:nTOP = 200
ACTIVATE WINDOW oWndAGENDA CENTERED
I use it exactly in Dialogs, considering Dialog in ON INIT and it works perfectly.
Re: ButtonBar in a specific location
Posted: Mon Mar 30, 2020 3:39 pm
by cnavarro
Christiano, try with this, and tell me ( my name is Cristobal )
Code: Select all
//----------------------------------------------------------------------------//
#include "Fivewin.ch"
#include "ttitle.ch"
Function Main
local oTitle
local oBarAgenda
local oWndAgenda
local oBtnADICIONAR
local oBtnVISUALIZAR
local oBtnALTERAR
local oBtnEXCLUIR
local oBtnRELATORIOS
local oBtnSAIR
DEFINE WINDOW oWndAGENDA FROM 0,0 TO 600,1041 PIXEL TITLE "GAM - AGENDA DE CONTATOS" COLORS nRGB(215,243,366),nRGB(215,215,215) NO MAXIMIZE
@ 0000,0000 TITLE oTitle OF oWndAGENDA SIZE 1025,0059 NOBORDER //PIXEL
oTitle:aGrdBack := {{1,nRGB(150,150,150),nRGB(150,150,150)}}
oTitle:nShadow := 0
@ 0010,0020 TITLEIMG OF oTitle BITMAP "TIT_AGENDA" SIZE 0052,0052
@ 0015,0120 TITLETEXT OF oTitle TEXT "Agenda Telefônica" COLOR nRGB(255,255,255)
@ 0040,0120 TITLETEXT OF oTitle TEXT "CONTATOS" COLOR nRGB(000,000,000)
@ 60, 0 BUTTONBAR oBarAGENDA 3DLOOK OF oWndAGENDA TOP SIZE 0740, 0078
oBarAgenda:bRClicked := { || nil }
oBarAgenda:l2015 := .T.
oBarAgenda:nBtnWidth := 120
oBarAgenda:nBtnHeight := 78
DEFINE BUTTON oBtnADICIONAR OF oBarAGENDA PROMPT "Adicionar"
DEFINE BUTTON oBtnVISUALIZAR OF oBarAGENDA PROMPT "Visualizar"
DEFINE BUTTON oBtnALTERAR OF oBarAGENDA PROMPT "Editar"
DEFINE BUTTON oBtnEXCLUIR OF oBarAGENDA PROMPT "Excluir"
DEFINE BUTTON oBtnRELATORIOS OF oBarAGENDA PROMPT "Relatórios" GROUP
DEFINE BUTTON oBtnSAIR OF oBarAGENDA PROMPT "Sair" GROUP ACTION oWndAgenda:End()
ACTIVATE WINDOW oWndAGENDA CENTERED
Return nil
//----------------------------------------------------------------------------//
Re: ButtonBar in a specific location
Posted: Mon Mar 30, 2020 3:48 pm
by ctoas
It worked!
Thank you very much