#include "FiveWin.ch"
function Main()
local oWnd, oImage
DEFINE IMAGE oImage FILENAME "..\bitmaps\pngs\chart.png"
DEFINE WINDOW oWnd
ACTIVATE WINDOW oWnd ;
ON PAINT DrawBitmap( hDC, oImage:hBitmap, 0, 0, oWnd:nWidth, oWnd:nHeight )
oImage:End()
return nil
// TESTING ROUNDSIZE
#include "FiveWin.ch"
#include "ribbon.ch"
//----------------------------------------------------------------------------//
function Main()
local oGrupo, oBtn1, oRibbon, oWnd
local oBtn2, oBtn3, oBtn4
SetBalloon( .T. )
DEFINE WINDOW oWnd FROM 1, 1 To 22, 75 ;
TITLE "This is a MDI enviroment"
DEFINE RIBBONBAR oRibbon PROMPTS "Start","Edition","Tools","Themes","Help" OF oWnd ;
HEIGHT 200 TOPMARGIN 25
ADD GROUP oGrupo RIBBON oRibbon TO OPTION 1 PROMPT "Only a Group to Test"
@ 05,04 ADD BUTTON oBtn1 PROMPT "Round 2" ;
GROUP oGrupo SIZE 142, 25 Right BORDER ROUND ROUNDSIZE 2
@ 35,04 ADD BUTTON oBtn1 PROMPT "Round 4" ;
GROUP oGrupo SIZE 142, 25 Right BORDER ROUND ROUNDSIZE 4
@ 65,04 ADD BUTTON oBtn1 PROMPT "Round 6" ;
GROUP oGrupo SIZE 142, 25 Right BORDER ROUND ROUNDSIZE 6
@ 95,04 ADD BUTTON oBtn1 PROMPT "Round 8" ;
GROUP oGrupo SIZE 142, 25 Right BORDER ROUND ROUNDSIZE 8
@ 125,04 ADD BUTTON oBtn1 PROMPT "Round 10" ;
GROUP oGrupo SIZE 142, 25 Right BORDER ROUND ROUNDSIZE 10
oRibbon:aDialogs[ 1 ]:bGotFocus = { | o | MsgInfo( "GotFocus 1" ) }
oRibbon:aDialogs[ 1 ]:bLostFocus = { | o | MsgInfo( "LostFocus 1" ) }
oRibbon:aDialogs[ 2 ]:bGotFocus = { | o | MsgInfo( "GotFocus 2" ) }
oRibbon:aDialogs[ 2 ]:bLostFocus = { | o | MsgInfo( "LostFocus 2" ) }
SET MESSAGE OF oWnd TO "A message bar"
ACTIVATE WINDOW oWnd
return nil
Pedro wrote:¿Para qué están las pestañas? ¿Acaso no es para pasar de un grupo, (o varios grupos) que hay dentro de cada una, a otra que contiene, nada, un grupo o varios grupos?
Pedro wrote:Si yo quiero desplegar un browse al entrar en edition no tengo por qué desplegarlo en themes,ni en tools. Cuando entre en esas opciones desplegaré la acción asociada a su pestaña, ya que los botones o grupos de botones, (ya que al menos un grupo ha de tener la pestaña) tendrán que hacer las acciones asociadas al tema de la pestaña.
Pedro wrote:No sería más facil, por ejemplo, al entrar en albaranes, desplegar un browse de albaranes, ejecutar las acciones de sus botones y al cambiar de pestaña cerrar ese browse.
O en una gestión de cobros, al entrar en facturas, desplegar una ventana con un browse de la tabla de facturas, cuando sales cierras. Entras en cobros despliegas una ventana con un browse de la tabla de cobros, o si entras en talones abrir la tabla de talones, no sé son sólo unos ejemplos.
#include "fivewin.ch"
#include "ribbon.ch"
function main()
local o
o = TApp():new()
o:oMain = o
o:run()
return nil
class TParent
classdata oMain
data hObjs
data hDatas
method new()
endclass
method TParent:new()
::hObjs = {=>}
::hDatas = {=>}
return self
//------------------------------------------------//
class TApp from TParent
data hActions
method buildStart()
method buildEdition()
method new()
method run()
method closePanel()
method movePanel(nWidth, nHeight)
method selectOption(nNew, nOld ) inline eval( ::hActions[nNew] )
method validaPanel()
method activateWindow()
method defineWindow()
endclass
//------------------------------------------------//
method TApp:new()
::Super:new()
::hActions = {=>}
::hActions[1] = {|| TStart():run() }
::hActions[2] = {|| TEdition():run() }
::hActions[3] = {|| TApp():validaPanel() }
::hActions[4] = {|| TApp():validaPanel() }
::hActions[5] = {|| TApp():validaPanel() }
::hObjs["PANEL"] = nil
return Self
method TApp:buildStart()
local o := TStart()
add group ::hObjs["GRP1_START"] ribbon ::hObjs["RIBBON"] to option "START" prompt "Only a Group to Test"
@ 05,04 add button prompt "Boton 1 Start" ;
group ::hObjs["GRP1_START"] size 142, 25;
action o:button1()
@ 35,04 add button prompt "Boton 1 Start" ;
group ::hObjs["GRP1_START"] size 142, 25;
action o:button2()
return nil
method TApp:buildEdition()
add group ::hObjs["GRP1_EDITION"] ribbon ::hObjs["RIBBON"] to option "EDITION" prompt "Only a Group to Test"
@ 05,04 add button prompt "Boton 1 Edition" ;
group ::hObjs["GRP1_EDITION"] size 142, 25
@ 35,04 add button prompt "Boton 2 Edition" ;
group ::hObjs["GRP1_EDITION"] size 142, 25
return nil
method TApp:closePanel()
if ::oMain:hObjs["PANEL"] != nil
::oMain:hObjs["PANEL"]:end()
::oMain:hObjs["PANEL"] := nil
endif
return nil
method TApp:run()
local oMain := ::oMain
SetBalloon( .T. )
DEFINE WINDOW ::hObjs["MAIN_WND"] FROM 1, 1 To 22, 75
DEFINE RIBBONBAR ::hObjs["RIBBON"] PROMPTS "Start","Edition","Tools","Themes","Help" OF ::hObjs["MAIN_WND"] ;
HEIGHT 160 TOPMARGIN 25 2010
::buildStart()
::buildEdition()
::hObjs["RIBBON"]:bAction = {| nNewOption, nOldOption | ::selectOption( nNewOption, nOldOption ) }
::selectOption(1)
ACTIVATE WINDOW ::hObjs["MAIN_WND"];
on resize( oMain:movePanel( nWidth, nHeight ) )
return nil
method TApp:movePanel( nWidth, nHeight )
local oMain := ::oMain
local nH := ::oMain:hObjs["RIBBON"]:nHeight
if ::oMain:hObjs["PANEL"] != nil
if nWidth != nil .and. nHeight != nil
::oMain:hObjs["PANEL"]:move( nH, 5, nWidth - 8, nHeight - nH - 4 )
endif
endif
return nil
method TApp:validaPanel()
if ::oMain:hObjs["PANEL"] != nil
::oMain:closePanel()
::oMain:hObjs["MAIN_BRUSH"]:end()
end
return nil
method TApp:defineWindow( nClr )
define brush ::oMain:hObjs["MAIN_BRUSH"] COLOR nClr
define window ::oMain:hObjs["PANEL"] ;
style nOR( WS_CHILD, WS_VISIBLE, WS_CLIPCHILDREN ) of ::oMain:hObjs["MAIN_WND"];
from 217, 5 to ::oMain:hObjs["MAIN_WND"]:nHeight, ::oMain:hObjs["MAIN_WND"]:nWidth pixel;
brush ::oMain:hObjs["MAIN_BRUSH"]
return nil
method TApp:activateWindow()
local oMain := ::oMain
activate window ::oMain:hObjs["PANEL"] ;
on init ( oMain:movePanel( oMain:hObjs["MAIN_WND"]:nWidth-16, oMain:hObjs["MAIN_WND"]:nHeight-38 ) )
return nil
//------------------------------------------------//
class TStart from TParent
method button1() inline MsgInfo("Action Button 1 Start")
method button2()
method run()
endclass
method TStart:button2()
::oMain:hObjs["MAIN_BRUSH"]:end()
define brush ::oMain:hObjs["MAIN_BRUSH"] color CLR_CYAN
::oMain:hObjs["PANEL"]:setBrush( ::oMain:hObjs["MAIN_BRUSH"] )
return nil
method TStart:run()
local oMain := ::oMain
::oMain:validaPanel()
::oMain:defineWindow( CLR_BLUE )
@ 10,10 say "ESTOY EN START" pixel
@ 40,10 button "Selecciona Edition" of ::oMain:hObjs["PANEL"] size 120,20 pixel action oMain:hObjs["RIBBON"]:setOption(2)
::oMain:activateWindow()
return nil
//------------------------------------------------//
class TEdition from TParent
method run()
endclass
method TEdition:run()
local oMain := ::oMain
::oMain:validaPanel()
::oMain:defineWindow( CLR_RED )
@ 10,10 say "ESTOY EN EDITION" pixel
@ 40,10 button "Selecciona start" of ::oMain:hObjs["PANEL"] size 120,20 pixel action oMain:hObjs["RIBBON"]:setOption(1)
::oMain:activateWindow()
return nil
Hace exactamente eso, controla SUS grupos y controles dentro de la ribbon, no fuera de la ribbon.
Si bien existe un espacio sin utilizar debajo de la ribbon, util para desplegar controles, lo que muestras o quitas en ese espacio dependera de ti y como lo manipules segun la logica de tu sistema
exactamente lo que te comente anteriormente...
si quieres desplegar el browse (en el espacio libre debajo de la ribbon) deberas controlar tu ese proceso, hacer las verificaciones pertinentes para que eso sea posible
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 40 guests