REDIMENSIONAR VENTANA MDI STYLE POPUP [SOLUCIONADO]

REDIMENSIONAR VENTANA MDI STYLE POPUP [SOLUCIONADO]

Postby JESUS MARIN » Sat Mar 25, 2023 6:16 am

Buenos dias a todos.
En el foro en ingles, leí un post donde alguien desarrolló algo para poder redimensionar una ventana MDI (tMdiFrame) con estilo POPUP.

¿alguien tiene localizado ese post?

Llevo horas buscandolo y no lo encuentro
Gracias
Jesús Marín
JESUS MARIN
 
Posts: 174
Joined: Wed Jan 02, 2019 8:36 am

Re: REDIMENSIONAR VENTANA MDI STYLE POPUP [SOLUCIONADO]

Postby JESUS MARIN » Thu Mar 30, 2023 4:49 am

Me contesto yo mismo.


oWnd:bLClicked = { | nRow, nCol | ...... } // activa la acción al pulsar boton izquierdo

oWnd:bMMoved = { | nRow, nCol | ...... } // controla movimiento del raton

oWnd:bLButtonUp = { | nRow, nCol | ........ } // al soltar o dejar de pulsar boton izquierdo

Saludos

Jesús Marín
Valencia (España)
Jesús Marín
JESUS MARIN
 
Posts: 174
Joined: Wed Jan 02, 2019 8:36 am

Re: REDIMENSIONAR VENTANA MDI STYLE POPUP [SOLUCIONADO]

Postby karinha » Thu Mar 30, 2023 10:47 am

JESUS MARIN wrote:Me contesto yo mismo.


oWnd:bLClicked = { | nRow, nCol | ...... } // activa la acción al pulsar boton izquierdo

oWnd:bMMoved = { | nRow, nCol | ...... } // controla movimiento del raton

oWnd:bLButtonUp = { | nRow, nCol | ........ } // al soltar o dejar de pulsar boton izquierdo

Saludos

Jesús Marín
Valencia (España)


Asi Jesús?

Code: Select all  Expand view

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

#include "FiveWin.ch"

#define CLR_MSPURPLE     RGB( 128,  57, 123 )
#define CLR_MSRED        RGB( 232,  17,  35 )
#define CLR_MSGRAY       RGB( 229, 229, 229 )
#define CLR_MSLIGHTGRAY  RGB( 243, 243, 243 )

#define TME_LEAVE    2

#define _nClrPaneRB       CLR_MSPURPLE
#define _nClrBoxOutRB     CLR_MSLIGHTGRAY
#define _nClrBoxInRB      CLR_MSLIGHTGRAY
#define _nClrBoxSelOut    CLR_MSLIGHTGRAY
#define _aGradRB          { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
#define _aGradHighRB      { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
#define _aGradOverRB      { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }

function Main()

   local oWnd, nRowPos, nColPos, oBtnClose, oBtnMax, oBtnMin, lDrag := .F.
   local oRb

   DEFINE WINDOW oWnd STYLE WS_POPUP COLOR CLR_BLACK, CLR_MSPURPLE

   oWnd:SetSize( 1000, 500 )
   oWnd:Shadow()
   oWnd:Center()

   oWnd:bLClicked = { | nRow, nCol | If( nRow < 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lDrag := .T. ),) }
     
   oWnd:bMMoved = { | nRow, nCol | TrackMouseEvent( oWnd:hWnd, TME_LEAVE ),;
                                   If( lDrag .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),;
                                       oWnd:Move( oWnd:nTop + nRow - nRowPos, oWnd:nLeft + nCol - nColPos,,, .T. ),) }  

   oWnd:bLButtonUp = { || ReleaseCapture(), lDrag := .F. }
   oWnd:bMLeave    = { || lDrag := .F. }

   @ 1, oWnd:nWidth - 46 BTNBMP oBtnClose BITMAP "../bitmaps/16x16/closew.bmp" ;
      FLAT NOBORDER NOROUND ACTION oWnd:End() SIZE 45, 29 ;
      COLOR CLR_BLACK, CLR_MSPURPLE

   @ 1, oWnd:nWidth - 92 BTNBMP oBtnMax BITMAP "../bitmaps/16x16/max.bmp" ;
      FLAT NOBORDER NOROUND ACTION If( ! IsZoomed( oWnd:hWnd ), oWnd:Maximize(), oWnd:Restore() ) SIZE 45, 29 ;
      COLOR CLR_BLACK, CLR_MSPURPLE

   @ 1, oWnd:nWidth - 138 BTNBMP oBtnMin BITMAP "../bitmaps/16x16/min.bmp" ;
      FLAT NOBORDER NOROUND ACTION If( ! IsIconic( oWnd:hWnd ), oWnd:Iconize(), oWnd:Restore() ) SIZE 45, 29 ;
      COLOR CLR_BLACK, CLR_MSPURPLE

   oBtnClose:bMMoved = { || oBtnClose:SetColor( CLR_BLACK, If( oBtnClose:lMOver, CLR_MSRED, oWnd:nClrPane ) ) }
   oBtnMax:bMMoved   = { || oBtnMax:SetColor( CLR_BLACK, If( oBtnMax:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }
   oBtnMin:bMMoved   = { || oBtnMin:SetColor( CLR_BLACK, If( oBtnMin:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }

   oWnd:bResized = { || oBtnClose:Move( 1, oWnd:nWidth - 46 ), oBtnMax:Move( 1, oWnd:nWidth - 92 ),;
                        oBtnMin:Move( 1, oWnd:nWidth - 138 ), oRb:nWidth := oWnd:nWidth }

   oRb = TRibbonBar():New( oWnd,,,,, 120, 40, _nClrPaneRB, _nClrBoxOutRB, _nClrBoxInRB,,;
                           _nClrBoxSelOut, _aGradRB,, _aGradHighRB, _aGradOverRB,,,,,.T.)
   oWnd:oTop = nil
   oRb:nTop = 30
   oRb:nWidth = oWnd:nWidth
   oRb:SetStyles( .F., .T. )
   oRb:nClrPaneRB = CLR_MSPURPLE
   oRb:hSeparation = 4
   oRb:aGradFld = {|nOpt| iif( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
                                                     { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
   oRb:Default()
   AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_BLACK,;
       If( oRb:nOverPrompt( ScreenToClient( oRb:hWnd, GetCursorPos() )[ 1 ],;
           ScreenToClient( oRb:hWnd, GetCursorPos() )[ 2 ] ) == nPrompt, CLR_HRED, CLR_WHITE ) ) } )
   oRb:AddGroup( 185, "First", 1 )
   oRb:AddGroup( 185, "Second", 1 )
   oRb:AddGroup( 185, "Third", 1 )

   ACTIVATE WINDOW oWnd

return nil

// FIN / END
 


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

Re: REDIMENSIONAR VENTANA MDI STYLE POPUP [SOLUCIONADO]

Postby karinha » Thu Mar 30, 2023 10:52 am

Ó,

Code: Select all  Expand view

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

#include "FiveWin.ch"

#define CLR_MSPURPLE RGB( 0,  120, 215 )
#define CLR_MSRED    RGB( 232,  17,  35 )
#define CLR_MSGRAY   RGB( 229, 229, 229 )

#define TME_LEAVE    2

Static oWnd, oFontMenu, oFont

function Main()

   local nRowPos, nColPos, oBtnClose, oBtnMax, oBtnMin, lDrag := .F., lRResize := .F., lBResize := .F.
   LOCAL cFont  := "Tahoma"
   LOCAL cFontH := -14

   DEFINE FONT oFontMenu NAME cFont SIZE 0, cFontH WEIGHT 300
   DEFINE FONT oFont     NAME cFont SIZE 0, cFontH - 2 // WEIGHT 300

   DEFINE WINDOW oWnd STYLE WS_POPUP COLOR CLR_BLACK, CLR_MSPURPLE MDI ;
      MENU MyMenu()

   //oWnd:SetSize( 500, 300 )
   //oWnd:Center()
   oWnd:Shadow()

   /*
   oWnd:bPainted = { || oWnd:Say( 8, 30, "Caption Color", CLR_RED, CLR_MSPURPLE, oWnd:oFont, .T., .T. ) }

   oWnd:bLClicked = { | nRow, nCol | If( nRow < 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lDrag := .T. ),),;
                                     If( nRow > 25 .and. nCol > oWnd:nWidth - 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lRResize := .T. ),),;
                                     If( nRow > 25 .and. nRow > oWnd:nHeight - 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lBResize := .T. ),) }
     
   oWnd:bMMoved = { | nRow, nCol | TrackMouseEvent( oWnd:hWnd, TME_LEAVE ),;
                                   If( lDrag .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),;
                                       oWnd:Move( oWnd:nTop + nRow - nRowPos, oWnd:nLeft + nCol - nColPos,,, .T. ),),;
                                   If( lRResize .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),;    
                                       ( oWnd:SetSize( oWnd:nWidth + nCol - nColPos, oWnd:nHeight, .T. ), nColPos := nCol ),),;
                                   If( lBResize .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),;    
                                       ( oWnd:SetSize( oWnd:nWidth, oWnd:nHeight + nRow - nRowPos, .T. ), nRowPos := nRow ),) }  

   oWnd:bLButtonUp = { || ReleaseCapture(), lDrag := .F., lRResize := .F., lBResize := .F. }
   oWnd:bMLeave    = { || lDrag := .F. }

//   @ 1, oWnd:nWidth - 46 BTNBMP oBtnClose BITMAP "../bitmaps/16x16/exit.bmp" ;
   @ 1, oWnd:nWidth - 46 BTNBMP oBtnClose BITMAP "../bitmaps/16x16/closew.bmp" ;
      FLAT NOBORDER NOROUND ACTION oWnd:End() SIZE 45, 29 ;
      COLOR CLR_BLACK, CLR_MSPURPLE

   @ 1, oWnd:nWidth - 92 BTNBMP oBtnMax BITMAP "../bitmaps/16x16/max.bmp" ;
      FLAT NOBORDER NOROUND ACTION If( ! IsZoomed( oWnd:hWnd ), oWnd:Maximize(), oWnd:Restore() ) SIZE 45, 29 ;
      COLOR CLR_BLACK, CLR_MSPURPLE

   @ 1, oWnd:nWidth - 138 BTNBMP oBtnMin BITMAP "../bitmaps/16x16/min.bmp" ;
      FLAT NOBORDER NOROUND ACTION If( ! IsIconic( oWnd:hWnd ), oWnd:Iconize(), oWnd:Restore() ) SIZE 45, 29 ;
      COLOR CLR_BLACK, CLR_MSPURPLE

   oBtnClose:bMMoved = { || oBtnClose:SetColor( CLR_BLACK, If( oBtnClose:lMOver, CLR_MSRED, oWnd:nClrPane ) ) }
   oBtnMax:bMMoved   = { || oBtnMax:SetColor( CLR_BLACK, If( oBtnMax:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }
   oBtnMin:bMMoved   = { || oBtnMin:SetColor( CLR_BLACK, If( oBtnMin:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }

   oWnd:bResized = { || oBtnClose:Move( 1, oWnd:nWidth - 46 ), oBtnMax:Move( 1, oWnd:nWidth - 92 ),;
                        oBtnMin:Move( 1, oWnd:nWidth - 138 ) }
   */


   ACTIVATE WINDOW oWnd MAXIMIZED

return nil

Function MyMenu()

   local oMenu

   // MENU oMenu HEIGHT -4.8 COLORMENU CLR_BLUE, CLR_WHITE ;
   MENU oMenu HEIGHT -4.8 COLORMENU CLR_BLACK, CLR_MSPURPLE ;
      FONT oFontMenu  // NOBORDER // 2013


      MENUITEM "&Archivos"
      MENU
         MENUITEM "&Clientes"                                //  ACTION Clientes(user)
         MENUITEM "&Proveedores"                             //  ACTION Proveed()
         MENUITEM "&Stocks"                                  //  ACTION  Stock()
         MENUITEM "&Componentes"                             //  ACTION  iStock()
         MENUITEM "&Cuentas Corrientes por Cliente"          //  ACTION  CtacteT()
         MENUITEM "&Vendedores"                              //  ACTION  Vendedor()
         MENUITEM "&Comprobantes Emitidos"                   //  ACTION  Facremit()
         MENUITEM "&Cobranzas"                               //  ACTION  Vfacrem()
         MENUITEM "&Recibos"                                 //  ACTION  Recibo1()
         MENUITEM "&Transporte"                              //  ACTION  Tra()
         MENUITEM "&Generar Etiquetas Precios y Cod. Barr."  //  ACTION  mainprub()
         MENUITEM "&Generar Etiquetas Precios y Cod. Barr."  //  ACTION  pruebax()
      ENDMENU

      MENUITEM "&Ventas"
      MENU
         MENUITEM  oemtoansi("&Facturaci¢n")         //  Action (xtipo:= "factura",GRID())
         MENUITEM  oemtoansi("&Facturaci¢n PRUEBA")  //  Action (xtipo:= "factura",SBARRAY())
         MENUITEM  oemtoansi("&Remitos")             //  Action ( xtipo:= "remito",RGRID())
         MENUITEM  oemtoansi("&Pedidos")             //  Action (xtipo:= "pedido",PGRID())
      ENDMENU

      MENUITEM "&Compras"
      MENU
         MENUITEM  oemtoansi("&Compras")                                   //  Action cGRID()
         MENUITEM  oemtoansi("&Consultas Compras x Proveedores Facturas")  //  Action ( compras() )
         MENUITEM  oemtoansi("&Consultas Compras x Proveedores Totales ")  //  Action ( comprasp() )
         MENUITEM  oemtoansi("&Cuentas Corrientes  Proveedores")           //  Action ( CTACTET1() )
      ENDMENU

      MENUITEM "Caja"
      MENU
         MENUITEM "&Caja"                 //  ACTION  Caja()
         MENUITEM "Tarjetas de &credito"  //  ACTION  TARJETA()
      ENDMENU

      MENUITEM "Cheques"
      MENU
         MENUITEM "C&heques"                 //  ACTION  CHEQUE()
         MENUITEM "Vencimietos de C&heques"  //  ACTION  cCHEck()
      ENDMENU

      MENUITEM "Bancos"
      MENU
         MENUITEM "&Cuentas "                //  ACTION  CUENTAS()
         MENUITEM "&Movimientos Bancarios "  //  ACTION  Movban()
         MENUITEM "&Cuentas/Saldos "         //  ACTION  Salban()
         MENUITEM "&Importar desde Excel "   //  action   (rBancosS(),impoexcel1c())
      ENDMENU

      MENUITEM "&Libros IVA"
      MENU
         MENUITEM "&IVA Ventas"                                           //  ACTION  livav()
         MENUITEM "&Exportar a Regimen Informacion Ventas Comprobantes"   //  ACTION  CITIVC()
         MENUITEM "&Exportar a Regimen Informacion Ventas Alicuotas"      //  ACTION  CITIVCA()
         MENUITEM  oemtoansi("&IVA Compras")                              //  Action livac()
         MENUITEM "&Exportar a Regimen Informacion Compras Comprobantes"  //  ACTION  CITICC()
         MENUITEM "&Exportar a Regimen Informacion Compras Alicuotas"     //  ACTION  CITICCA()
      ENDMENU

      MENUITEM "&Informes y Estadisticas"
      MENU
         MENUITEM "&Ventas Diarias y Mensuales"                                         //  action Vdym()
         *MENUITEM "&Ventas Diarias y Mensuales por horario"                            //  *action Vdymh()
         MENUITEM "&Ventas Diarias y Mensuales Por Rubro"                               //  action Vdym2()
         MENUITEM "&Ventas Diarias y Mensuales Por Vendedor"                            //  action Vdymv()
         MENUITEM "&Presupuestos / Pedidos  Diarios y Mensuales Por Cliente detallada"  //  action Vdyp()
         MENUITEM "&Presupuestos / Pedidos diarios y mensuales"                         //  action Vdymp()
         MENUITEM "&Listado de  Precios 1 "                                             //  action  (repLPRE(),lstoc())
         MENUITEM "&Listado de  Precios 2 "                                             //  action  (repLPRE(),lstoc1())
         MENUITEM "&Listado de  Precios 3 "                                             //  action  (repLPRE(),lstoc2())
         MENUITEM "&Listado de  Precios 4 "                                             //  action  (repLPRE(),lstoc3())
      ENDMENU

      MENUITEM OEMTOANSI("Configuraci¢n")
      MENU
         MENUITEM "&Empresa"                       //         ACTION  empresa()
         MENUITEM "&Back Up de Archivos"           //         ACTION  czip()
         MENUITEM "&Restaurar Archivos"            //         ACTION  dzip()
         MENUITEM "&Numeracion de Comprobantes"    //         ACTION  talonar()
         MENUITEM "&Rubros"                        //         ACTION  Rubro()
         MENUITEM "&Rubros Compras"                //         ACTION  Rubroc()
         MENUITEM "&Cotizacion Monedas"            //         ACTION  Cotiz()
         MENUITEM "&Usuarios"                      //         ACTION  User()
         MENUITEM "&Reorganizacion de archivos"    //         ACTION  Indexa()
         MENUITEM "&Modificacion de Codigo Stock"  //         ACTION  Mstock()
         MENUITEM "&Texto"                         //         ACTION  clausula()
         MENUITEM "&Datos Conexion"                //         ACTION  Dconex()
         MENUITEM "&Aumento de Precios"            //         ACTION  Aumento()
      ENDMENU

      MENUITEM "&Salir"  ACTION ( oWnd:End() )
      MENUITEM ""  
      MENUITEM ""
      MENUITEM ""
      MENUITEM ""
      MENUITEM ""  
      MENUITEM ""
      MENUITEM ""
      MENUITEM ""
      MENUITEM "-" //FONT oFont
      MENUITEM "x" //FONT oFont

   ENDMENU
 
Return oMenu

// FIN / END
 


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

Re: REDIMENSIONAR VENTANA MDI STYLE POPUP [SOLUCIONADO]

Postby JESUS MARIN » Thu Mar 30, 2023 10:53 am

Si Joao
Mas o menos. Porque tengo una version de FWH muy antigua y no todo me funciona :)
En breve, pongo video
Saludos
Jesús Marín
JESUS MARIN
 
Posts: 174
Joined: Wed Jan 02, 2019 8:36 am

Re: REDIMENSIONAR VENTANA MDI STYLE POPUP [SOLUCIONADO]

Postby karinha » Thu Mar 30, 2023 11:03 am

JESUS MARIN wrote:Si Joao
Mas o menos. Porque tengo una version de FWH muy antigua y no todo me funciona :)
En breve, pongo video
Saludos


Bién, y también el código. Estoy aprendendo(novato). jajajajajajaja.

Gracias.

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


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 11 guests