Page 2 of 2

Re: a question MDI

Posted: Tue Jan 11, 2022 11:05 am
by Silvio.Falconi
Application
===========
Path and name: C:\work\Errori\testMdi\testmdi.Exe (32 bits)
Size: 4,605,440 bytes
Compiler version: Harbour 3.2.0dev (r1904111533)
FiveWin version: FWH 21.11
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.1, Build 7601 Service Pack 1

Time from start: 0 hours 0 mins 3 secs
Error occurred at: 01/11/22, 12:05:27
Error description: Error BASE/1004 No exported method: EVAL
Args:
[ 1] = A {.T.} length: 1
[ 2] = N 2
[ 3] = N 746
[ 4] = N 638

Re: a question MDI

Posted: Tue Jan 11, 2022 1:57 pm
by cmsoft

Code: Select all | Expand

Function test1(oWnd)
   Local oBrw,oBar, oWndClients, oMsgBar

   use customer

   DEFINE WINDOW oWndClients MDICHILD OF oWnd TITLE "Clients"

   @ 2, 0 XBROWSE oBrw OF oWndClients LINES AUTOSORT ;
         AUTOCOLS DATASOURCE "Customer" NOBORDER
      oBrw:CreateFromCode()
      oBrw:SetFocus()

      DEFINE BUTTONBAR oBar OF oWndClients 2015 SIZE 70, 60

     oWndClients:oClient = oBrw
     oWndClients:oControl = oBrw

      DEFINE MSGBAR oMsgBar OF oWndClients 2015
    oWndClients :bMoved    := { |nRow, nCol| IF(nCol < 150,oWndClients :Move(150,oWndClients :nTop),.t.) }
    oWndClients :bResized    := {||  IF(oWndClients:nLeft < 150 ,oWndClients :Move(150,oWndClients :nTop),.t.) }
    ACTIVATE WINDOW oWndClients MAXIMIZED ;
         VALID ( oWndClients := nil, .T. )
    return nil

Me faltaron los ||

Re: a question MDI

Posted: Tue Jan 11, 2022 10:54 pm
by Silvio.Falconi
cmsoft wrote:

Code: Select all | Expand

Function test1(oWnd)
   Local oBrw,oBar, oWndClients, oMsgBar

   use customer

   DEFINE WINDOW oWndClients MDICHILD OF oWnd TITLE "Clients"

   @ 2, 0 XBROWSE oBrw OF oWndClients LINES AUTOSORT ;
         AUTOCOLS DATASOURCE "Customer" NOBORDER
      oBrw:CreateFromCode()
      oBrw:SetFocus()

      DEFINE BUTTONBAR oBar OF oWndClients 2015 SIZE 70, 60

     oWndClients:oClient = oBrw
     oWndClients:oControl = oBrw

      DEFINE MSGBAR oMsgBar OF oWndClients 2015
    oWndClients :bMoved    := { |nRow, nCol| IF(nCol < 150,oWndClients :Move(150,oWndClients :nTop),.t.) }
    oWndClients :bResized    := {||  IF(oWndClients:nLeft < 150 ,oWndClients :Move(150,oWndClients :nTop),.t.) }
    ACTIVATE WINDOW oWndClients MAXIMIZED ;
         VALID ( oWndClients := nil, .T. )
    return nil

Me faltaron los ||



Cristobal have create a test run ok

Code: Select all | Expand

function WindowChild(oWnd)
   local oWndChild
   local oFolder, oSay, oSay1
   local x
   local nPosR  := 0
   local nPosC  := 0

   if Len( oWnd:oWndClient:aWnd ) > 0
      if ( nRow + nHChild ) > oWnd:nHeight
         nRow  := 0
         if ( nCol + Int( nWChild / 2 ) ) > oWnd:nWidth
            nCol := 0
         else
            nCol += Int( nWChild / 2 )
         endif
      else
         nRow  += Int( nHChild / 4 )
      endif
   endif

   DEFINE WINDOW oWndChild MDICHILD OF oWnd ;
      FROM nRow + 1 , nCol TO nHChild, nWChild PIXEL //NOSYSMENU //BRUSH oWndCalend:oBrush  // NOCAPTION

   @ 0, 0 FOLDER oFolder OF oWndChild
   oWndChild:oClient := oFolder
   
   ACTIVATE WINDOW oWndChild ;
      ON INIT oWndChild:cToolTip := oWndChild:cCaption ;
      ON MOVE ( oWndChild:CoorsUpdate(), ;
                if( oWndChild:nLeft < 1, oWndChild:Move( oWndChild:nTop, 0 ), ), ;
                if( oWndChild:nTop  < 2, oWndChild:Move( 1, oWndChild:nLeft ), ) )

return oWndChild
 

Re: a question MDI

Posted: Tue Jan 11, 2022 11:26 pm
by cmsoft
Excelente!
Me alegro que lo hayas podido resolver

Re: a question MDI

Posted: Thu Jan 13, 2022 12:51 pm
by cnavarro
karinha wrote:
cnavarro wrote:Silvio, use Splitter for this
Look my sample
https://bitbucket.org/fivetech/fivewin- ... estmdi.prg



Mestre Navarro, publique un ejemplo que, cuando se compila, funciona correctamente. ¿Y dónde está ese camión lleno de BitMaps que el programa va a buscar en un directorio infinito? ¿Es posible crear un .RAR y poner a disposición el SOURCE, un .EXE y los BITMAPS de este ejemplo para realizar pruebas? Sea práctico, por favor. Gracias.



Joao, no es posible publicar los bitmaps, pertenecen a microsoft y sólo se pueden utilizar si compilas con Visual Studio

Re: a question MDI

Posted: Thu Jan 13, 2022 1:15 pm
by karinha
cnavarro wrote:
karinha wrote:
cnavarro wrote:Silvio, use Splitter for this
Look my sample
https://bitbucket.org/fivetech/fivewin- ... estmdi.prg



Mestre Navarro, publique un ejemplo que, cuando se compila, funciona correctamente. ¿Y dónde está ese camión lleno de BitMaps que el programa va a buscar en un directorio infinito? ¿Es posible crear un .RAR y poner a disposición el SOURCE, un .EXE y los BITMAPS de este ejemplo para realizar pruebas? Sea práctico, por favor. Gracias.



Joao, no es posible publicar los bitmaps, pertenecen a microsoft y sólo se pueden utilizar si compilas con Visual Studio


Está bien, mi querido maestro. Necesitas aprender a compilar con BORLAND. jajajajajajajajaja, broma, broma, broma.

Regards, saludos.

Re: a question MDI

Posted: Thu Jan 13, 2022 1:17 pm
by cnavarro
https://www.microsoft.com/en-us/downloa ... x?id=35825

Borland sólo para pruebas rápidas :D :D :D :D

Re: a question MDI

Posted: Tue Jan 18, 2022 10:38 pm
by James Bott
Sample using Explorer Bar and MDI windows.

Code: Select all | Expand

/*
Purpose : Test ExplorerBar with MDI
Author  : James Bott, jbott@compuserve.com
Company : Intellitech, gointellitech.com
Date    : 09/28/10 13:53:39
Language: Fivewin Harbour/xHarbour
Notes   :

*/



#include "fivewin.ch"
#include "color.ch"

static oWnd1, oWnd2

function main()
   local oWnd, oBar

   define window oWnd title "Test Explorerbar with MDI Windows" MDI

   define buttonbar oBar of oWnd 3d

   oWnd:oLeft:= buildExbar(oWnd)

   activate window oWnd on init Init()

return nil

//---------------------------------------------------------------------------//

Function Init()
   local oBar, oBar2

   define window oWnd1 mdichild ;
     nominimize nosysmenu;
     color CLR_BLACK,CLR_BLUE ;
     of wndMain()
   activate window oWnd1 maximized

   define window oWnd2 mdichild ;
     nominimize nosysmenu;
     color CLR_BLACK,CLR_RED ;
     of wndMain()
   define buttonbar oBar2 of oWnd2 3d
   activate window oWnd2 maximized

return nil

//---------------------------------------------------------------------------//

function buildExbar( oWnd )

   local oExBar, oPanel1

   oExBar = TExplorerBar():New(0,0,150,400,oWnd)

   oPanel1 = oExBar:AddPanel( "One", "c:\fwh\bitmaps\32x32\people.bmp" )
   oPanel1:lSpecial = .T.
   oPanel1:AddLink( "Providers", {|| oWnd1:maximize(), oWnd1:setfocus()}, "c:\fwh\bitmaps\16x16\additem.bmp" )
   oPanel1:AddLink( "Patients", {|| oWnd2:maximize(), oWnd2:setFocus()}, "c:\fwh\bitmaps\16x16\copy.bmp" )

return oExBar

//----------------------------------------------------------------------------//