FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Gantt class
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 11:17 AM

but I cannot publish his work... without his autorization !!!

FWH .. BC582.. xharbour
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 12:05 PM

aca arturo indica que retiro la clase por problemas de "distribucion", :-) ya que alguien la estaba vendido como suya por 300.00 euros.

http://www.lawebdelprogramador.com/foro ... Gantt.html

si realizamos una busqueda en el foro por la palabra tgantt, no encontramos recurrentemente que la autoria de la clase se le atribuye a Ramon Avenda帽o, gran colaborador y desarrollador de clases de gratuitas para fivewin.

asi mismo Arturo nunca da indicios que la clase no sea otra cosa que un desarrollo suyo.

creo que lo mejor es que la comunidad realize el desarrollo de una nueva clase tgantt publica, o que fivetech la desarrolle como parte de su producto, para evitar este tipo de problemas.

salu2
carlos vargas

Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: Gantt class
Posted: Fri Sep 30, 2011 12:26 PM

Carlos,

Arturo la copi贸 de Ram贸n.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 159
Joined: Wed Mar 28, 2007 01:19 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 02:32 PM

Hi to all, sorry for jumping in, but just could not resist... :D

From the "lawebdelprogramador.com"

arturo tamayo wrote:
Nota, decidi no publicarlo mas esta clase por ya hay un italiano que la copio y la esta vendiendo creo que en 300 euros

guess who is the italian selling the copy for 300 euros :?: :?: :?:

Regards/Saludos to everybody
Euclides

Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 04:27 PM
I have to make a clarification:

Ramon made a class called TGraph.prg this class no have mousemove actions : it is a static class as you can see on this picture



Arthuro made mousemove actions methods on Tgraph.prg and recall it into Tgantt.prg

I made mouse move actions methods and other features from Tgraph.prg and recal it into Tplan.prg and if I create modification can sal my sources ?

I not decompiled Arthuro class , Arthuro not sad the truth , he copyed the class from Ramon !!!

I can try at any time even before a judge that I never decompiled class because I have original files of Ramon from 1998 and then I had no interest to decompile the class of Arthuro.


On mine sources of Tplan.prg there are these lines :
Code (fw): Select all Collapse
/*-------------------------------------------------------------------------\
| 聽 聽 聽 聽Class: Class Tplan 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽|
| 聽 Descripton: Remake of Tgant class 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽|
| 聽 聽 Language: xharbour /fw 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 |
| 聽 聽 聽Version: 1.00 version. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽|
| 聽 聽 聽 聽 Date: 22/01/2000 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 |
| 聽 聽 聽 Author: Ramon Avendano, 1998 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 |
| 聽 聽 聽 Adds by: 聽 Silvio Falconi 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽|
| 聽 聽 聽 Rights: There are some restrictions to the use of this code. 聽 聽 聽 |
| 聽 聽 聽 聽 聽 聽 聽 Please read the README file that accompanied this code 聽 聽 |
| 聽 聽 聽 聽 聽 聽 聽 before using it or modifying it. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 |
| 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽|
| 聽 Warranties: None. The code has not been rigorously tested in a formal 聽|
| 聽 聽 聽 聽 聽 聽 聽 development environment, and is offered as-is. 聽The author |
| 聽 聽 聽 聽 聽 聽 聽 assumes no responsibility for its use, or for any 聽 聽 聽 聽 聽|
| 聽 聽 聽 聽 聽 聽 聽 consequences that may arise from its use. 聽 聽 聽 聽 聽 聽 聽 聽 聽|
| 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽|
|
\-------------------------------------------------------------------------*/
FWH .. BC582.. xharbour
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 04:37 PM
Euclides wrote:Hi to all, sorry for jumping in, but just could not resist... :-)

From the "lawebdelprogramador.com"

arturo tamayo wrote:
Nota, decidi no publicarlo mas esta clase por ya hay un italiano que la copio y la esta vendiendo creo que en 300 euros

guess who is the italian selling the copy for 300 euros :-) :-) :-)

Regards/Saludos to everybody
Euclides


Mr. Euclides,

Sure .... :-) Arthuro cannot pubblish it because he not created it and he cannot pubblish without the autorization on the original author...
FWH .. BC582.. xharbour
Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 05:33 PM
Hi to all, sorry for jumping in, but just could not resist...

From the "lawebdelprogramador.com"

arturo tamayo wrote:
Nota, decidi no publicarlo mas esta clase por ya hay un italiano que la copio y la esta vendiendo creo que en 300 euros

guess who is the italian selling the copy for 300 euros

Regards/Saludos to everybody
Euclides


There are something that I cannot understand regarding Mr. Arturo Tamayo statement:
"Nota, decidi no publicarlo mas esta clase por ya hay un italiano que la copio y la esta vendiendo creo que en 300 euros"
If Mr. Tamayo is the class' owner and he already decided to publish it, why stop if by doing that he will be helping the other person that is selling his class?

I think Mr. Tamayo should publish his class, if he has the source code, and by doing this, he is contributing to this forum.

George
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 05:42 PM
George,

Mr. Tamayo is NOT the class' owner, he copied it from tgraph 's Avendano class, he only made some modifications...

When Avendano sent me his class , he sad no send to anyone, but then on 2001 Arthuro published tgantt class object

it seems Ramon sent to me and to Arthuro his first project ...


George,
if Mr Tamayo is the class' owner he must explain why I have the Ramon Avendano sources






And I Know Arthuro lose his sources on 2006

and ask to me the first project of Ramon but I not sent it to Arthuro ( I have old messages on chat icq where Arthuro ask me the ramon class)
FWH .. BC582.. xharbour
Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 06:49 PM

Thanks Mr. MdaSolution for the clarification.
At this moment seems that Ramon Avendano, as we are not hearing from Mr. Tamayo, is the only one that can solve this puzzle.

George

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 07:17 PM

Can we download a working exe to see this class in action.
Best regards,
Otto

Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 07:20 PM

Hi,

Ram贸n published his class on the old OZS news server (news.fivetechsoft.com).

Arturo took this class and added Hernan麓s Browse.

I think both, Arturo and Silvio, tried to sell the class. But as original Ramon麓s autorship was public, both people stopped distributing this class.

Maybe Antonio has a copy of old OZS news.

Saludos,



Eduardo
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 07:29 PM

If someone has Ram贸n Avenda帽o Class TGant sources, please email them to me as we are going to test it, contact him and ask for authorization.

Does someone know the current email of Ram贸n ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 08:14 PM
We already got a written authorization from Ram贸n to publish his Class TGant source code, and he confirms that he does not longer its source code, so we kindly ask to however may have it to publish it here, thanks :-)

Hola F茅lix:

Yo no hice realmente una clase Tgantt, solo y hace mucho tiempo extraje de uno de mis programas la parte que generaba una grafica tipo Gantt y la retoque como ejemplo para alguien y se lo mande (no recuerdo a quien) para que hiciese lo que quisiera con ello.

No se s铆 en alg煤n viejo ordenador puedo tener algo de esto, pero creo que lo que en su momento hice sobre el tema lo he perdido.

He entrado en el enlace del foro que me adjuntas, creo que se ha montado un peque帽o lio de algo que hice hace mucho tiempo y que poco valor tenia y si alguien aun tiene algo m铆o sobre el tema lo puede publicar, aunque ya digo que de poco puede valer.

Para cualquier cosa m谩s escr铆beme a avendano@mundo-r.com, al que me has escrito apenas lo utilizo.

Un saludo,

Ram贸n Avenda帽o.

Un abrazo,
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Gantt class
Posted: Fri Sep 30, 2011 08:23 PM
Here we have an example of use:

http://code.google.com/p/fivewin-contributions/downloads/detail?name=gantt_example.zip&can=2&q=

Now we need its source code, please :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Gantt class
Posted: Sat Oct 01, 2011 09:26 AM
Finally Ram贸n Avenda帽o Class TGant sources are here and available to everybody :-)

gantt.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"

#define GWL_STYLE 聽 聽 聽 聽 聽 -16

Static nOldCol,nOldRow
Static nOldCol1,nOldCol2,nOldRow2

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

CLASS TGantt FROM TControl

聽 聽DATA 聽 nWidth, nHeight
聽 聽DATA 聽 aItems,lCaptured,lCaptuPre
聽 聽DATA 聽 nItem,nItePre
聽 聽DATA 聽 nRow1,nRow2,nCol1,nCol2 AS NUMERIC INIT 0
聽 聽DATA 聽 nRowi1,nRowi2,nColi1,nColi2 AS NUMERIC INIT 0
聽 聽DATA 聽 hTrazoPen
聽 聽DATA 聽 hOldPen
聽 聽DATA 聽 iRop,bLbx
聽 聽DATA 聽 nLCol,nRCol AS LOGICAL INIT .f.
聽 聽DATA 聽 bChange
聽 聽DATA 聽 bPresed
聽 聽DATA 聽 bTrovaTIP,bIniziofine 聽 聽 
聽 聽DATA 聽 cToolTip,cTipIniFine 聽 聽 聽

聽 聽CLASSDATA lRegistered AS LOGICAL

聽 聽METHOD New( nTop, nLeft, nWidth, nHeight, oWnd, lBorder,;
聽 聽 聽 聽 聽 聽 聽 聽lVScroll, lHScroll, nClrFore, nClrBack,bchange,dpresed,blbx) CONSTRUCTOR

聽 聽METHOD Redefine( nId, oWnd, nClrFore, nClrBack ) CONSTRUCTOR

聽 聽MESSAGE FillRect( aRect, oBrush,barra ) 聽METHOD _FillRect( aRect, oBrush,barra )

聽 聽METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0

聽 聽METHOD Paint()

聽 聽METHOD LButtonDown( nRow, nCol, nKeyFlags ) 
聽 聽METHOD LButtonUp( nRow, nCol, nKeyFlags ) 聽

聽 聽METHOD MouseMove( nRow, nCol, nKeyFlags ) 
聽 聽METHOD LDblClick( nRow, nCol, nKeyFlags ) 
聽 聽
聽 聽METHOD Line( nTop, nLeft, nBottom, nRight, oPen )
聽 聽METHOD Rectang( nTop, nLeft, nBottom, nRight, oPen,Barra )
聽 聽METHOD Say( nRow, nCol, cText, nClrFore, nClrBack, oFont, lPixel, ;
聽 聽 聽 聽 聽 聽 聽 聽lTransparent, nAlign ) 
聽 聽METHOD DibRect()
聽 聽METHOD DibLine()
聽 聽METHOD End()

ENDCLASS

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

METHOD New( nTop, nLeft, nWidth, nHeight, oWnd, lBorder,;
聽 聽 聽 聽 聽 聽 lVScroll, lHScroll, nClrFore, nClrBack,bChange,bPresed,blbx ) CLASS TGantt

// 聽 DEFAULT nWidth := 100, nHeight := 100,;
聽 聽DEFAULT lBorder := .T.,;
聽 聽 聽 聽 聽 聽lVScroll := .f., lHScroll := .f.,; 
聽 聽 聽 聽 聽 聽oWnd := GetWndDefault()

聽 聽::cCaption 聽 = ""
聽 聽::lCaptured = .f.
聽 聽::lCaptuPre = .f.
聽 聽::aitems 聽 = {}
聽 聽::nitem 聽 聽= 0
聽 聽::nitePre 聽 = 0
聽 聽::nTop 聽 聽 = nTop
聽 聽::nLeft 聽 聽= nLeft
聽 聽::nBottom 聽= nTop + nHeight - 1
聽 聽::nRight 聽 = nLeft + nWidth - 1
聽 聽::oWnd 聽 聽 = oWnd
聽 聽::bchange 聽= bChange
聽 聽::bPresed 聽= bPresed
聽 聽::bLbx 聽 聽 = bLbx
聽 聽::nStyle 聽 = nOr( WS_CHILD,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽If( lBorder, WS_BORDER, 0 ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽If( lVScroll, WS_VSCROLL, 0 ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽If( lHScroll, WS_HSCROLL, 0 ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽WS_VISIBLE, WS_TABSTOP)
聽 聽::Register() // nOR(CS_VREDRAW,CS_HREDRAW) )
聽 聽::cToolTip := ''
聽 聽::cTipIniFine := ''

聽 聽::SetColor( nClrFore, nClrBack )

聽 聽::htrazopen:=createpen(PS_SOLID,1,nRGB(128,128,128) )

聽 聽if oWnd:lVisible
聽 聽 聽 ::Create()
聽 聽 聽 ::Default()
聽 聽 聽 ::lVisible = .t.
聽 聽 聽 oWnd:AddControl( Self )
聽 聽else
聽 聽 聽 oWnd:DefControl( Self )
聽 聽 聽 ::lVisible 聽= .f.
聽 聽endif
/*
聽 聽if lVScroll
聽 聽 聽 DEFINE SCROLLBAR ::oVScroll VERTICAL OF Self
聽 聽endif
聽 聽if lHScroll
聽 聽 聽 DEFINE SCROLLBAR ::oHScroll HORIZONTAL OF Self
聽 聽endif
*/
return Self

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

METHOD Redefine( nId, oWnd, nClrFore, nClrBack,bChange, bPresed,blbx ) CLASS TGantt

聽 聽DEFAULT oWnd := GetWndDefault()

聽 聽::nId 聽 聽 聽 = nId
聽 聽::cCaption 聽= ""
聽 聽::lCaptured = .f.
聽 聽::lCaptuPre = .f.
聽 聽::oWnd 聽 聽 聽= oWnd
聽 聽::bchange 聽 = bChange
聽 聽::bPresed 聽 = bPresed
聽 聽::bLbx 聽 聽 聽= bLbx
聽 聽::nWidth 聽 聽= 100
聽 聽::nHeight 聽 = 100

聽 聽::Register()

聽 聽::SetColor( nClrFore, nClrBack )
聽 聽
聽 聽if lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), WS_VSCROLL )
聽 聽 聽 DEFINE SCROLLBAR ::oVScroll VERTICAL OF Self
聽 聽endif
聽 聽if lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), WS_HSCROLL )
聽 聽 聽 DEFINE SCROLLBAR ::oHScroll HORIZONTAL OF Self
聽 聽endif

聽 聽oWnd:DefControl( Self )

return Self

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

METHOD Paint() CLASS TGantt

聽 聽local oRect := ::GetRect()

聽 聽if ::bPainted != nil
聽 聽 聽 Eval( ::bPainted, ::hDC )
聽 聽endif

return 0 //nil

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

METHOD Line( nTop, nLeft, nBottom, nRight, oPen ) CLASS TGantt

聽 聽local hPen := if( oPen = nil, 0, oPen:hPen )

聽 聽::GetDC()
聽 聽MoveTo( ::hDC, nLeft, nTop )
聽 聽LineTo( ::hDC, nRight, nBottom, hPen )
聽 聽::ReleaseDC()

return nil

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

METHOD Rectang( nTop, nLeft, nBottom, nRight, oPen,barra ) CLASS TGantt

聽 聽local hPen := if( oPen = nil, 0, oPen:hPen )
聽 聽Local nBar := if( barra = nil, 0, barra)
聽 聽::GetDC()
聽 聽 聽Rectangle( ::hDC, nTop, nLeft, nBottom, nRight, hPen )
聽 聽::ReleaseDC()
/*
聽 聽if nbar > 0 
聽 聽 聽 if len(::aitems) >= nBar
聽 聽 聽 聽 聽::aitems[nbar]:={ntop,nleft,nBottom,nRight}
聽 聽 聽 else
聽 聽 聽 聽 聽AADD( ::aitems,{ntop,nleft,nBottom,nRight} )
聽 聽 聽 endif
聽 聽endif
*/
return nil

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

METHOD Say( nRow, nCol, cText, nClrFore, nClrBack, oFont, lPixel,;
聽 聽 聽 聽 聽 聽 lTransparent, nAlign ) CLASS TGantt

聽 聽DEFAULT nClrFore := ::nClrText,;
聽 聽 聽 聽 聽 聽nClrBack := ::nClrPane,;
聽 聽 聽 聽 聽 聽oFont 聽 聽:= ::oFont,;
聽 聽 聽 聽 聽 聽lPixel 聽 := .f.,;
聽 聽 聽 聽 聽 聽lTransparent := .f.

聽 聽if ValType( nClrFore ) == "C" 聽 聽 聽// 聽xBase Color string
聽 聽 聽 nClrBack = nClrFore
聽 聽 聽 nClrFore = nGetForeRGB( nClrFore )
聽 聽 聽 nClrBack = nGetBackRGB( nClrBack )
聽 聽endif

聽 聽::GetDC()

聽 聽DEFAULT nAlign := GetTextAlign( ::hDC )

聽 聽WSay( ::hWnd, ::hDC, nRow, nCol, cValToChar( cText ), nClrFore, nClrBack,;
聽 聽 聽 聽 聽If( oFont != nil, oFont:hFont, 0 ), lPixel, lTransparent, nAlign )
聽 聽::ReleaseDC()

return nil
//------------------//
METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TGantt
local neoitem,ctext
if ::lCaptured
聽 聽neoItem:=ASCAN(::aitems,{ |val| val[1] <= nRow .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽val[2] <= ncol .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽val[4] >= ncol .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽val[3] >= nRow }) 
聽 聽 聽if neoItem = 0 .and. ( nRow<=::nrow1+2 .or. nRow>=::nrow2-1 ) .and.;
聽 聽 聽 聽 聽::nlCol .and. ::nRCol
聽 聽 聽 if nCol>nOldCol1 .and. nCol<nOldcol2 聽 聽 聽 聽 
聽 聽 聽 聽 聽CURSOR("CURSOR_1")
聽 聽 聽 聽 聽::DibRect()
聽 聽 聽 聽 聽selectObject(::hDC,::hOldPen)
聽 聽 聽 聽 聽::ReleaseDC()
聽 聽 聽 聽 聽::lCaptured:=.f.
聽 聽 聽 聽 聽::lCaptuPre:=.t.
聽 聽 聽 聽 聽::nRowi1=::nRow2-1 
聽 聽 聽 聽 聽::nColi1=nOldCol2 
聽 聽 聽 聽 聽::nColi2=nCol
聽 聽 聽 聽 聽::nrowi2=nRow 
聽 聽 聽 聽 聽nOldRow:=::nRow2-1
聽 聽 聽 聽 聽nOldRow2:=::nRow2-1
聽 聽 聽 聽 聽nOldCol:=nOldCol2
聽 聽 聽 聽 聽::nRowi2:=nOldRow2+(nRow-nOldRow)
聽 聽 聽 聽 聽::nColi2:=nOldCol2+(nCol-nOldCol)
聽 聽 聽 聽 聽::holdpen:=Selectobject(::hDC,::hTrazoPen)
聽 聽 聽 聽 聽::DibLine()
聽 聽 聽 聽 聽ReTurn 0
聽 聽 聽 聽endif
/*
聽 聽 聽 //----- Disegna TIP
聽 聽 聽 IF ::bInizioFine # nil
聽 聽 聽 聽 聽IF ::lCAmbiaDay
聽 聽 聽 聽 聽 聽 ::DestroyToolTip()
聽 聽 聽 聽 聽ENDIF
聽 聽 聽 聽 聽eval(::bInizioFine)
聽 聽 聽 聽 聽IF ! empty(::cTipIniFine)
聽 聽 聽 聽 聽 聽 cText := substr(::cTipIniFine,1,5) + ' al ' + 聽substr(::cTipIniFine,12,5)
聽 聽 聽 聽 聽 聽 ::ShowToolTip( ::nBoxBottom + 3 , ::nBoxLeft ,cText )
聽 聽 聽 聽 聽ENDIF
聽 聽 聽 ENDIF
*/
聽 聽 聽endif
聽 聽::DibRect()
聽 聽 if ::nRCol .and. !::nLCol
聽 聽 聽 聽 聽CURSOR("CURSOR_2")
聽 聽 聽 聽if nOldCol2+(nCol-nOldCol) > ::ncol1
聽 聽 聽 聽 聽 ::nCol2:=nOldCol2+(nCol-nOldCol)
聽 聽 聽 聽endif
聽 聽 endif
聽 聽 if ::nlCol .and. !::nRCol
聽 聽 聽 聽 聽CURSOR("CURSOR_3")
聽 聽 聽 聽if nOldCol1+(nCol-nOldCol) < ::ncol2
聽 聽 聽 聽 聽::nCol1:=nOldCol1+(nCol-nOldCol)
聽 聽 聽 聽endif
聽 聽 endif
聽 聽 if ::nlCol .and. ::nRCol
聽 聽 聽 聽 聽CURSOR("CURSOR_4")
聽 聽 聽 聽 ::nCol1:=nOldCol1+(nCol-nOldCol)
聽 聽 聽 聽 ::nCol2:=nOldCol2+(nCol-nOldCol)
聽 聽 endif
聽 聽 ::DibRect()
聽 聽 ReTurn 0
endif
if ::lCaptuPre
聽 聽::DibLine()
聽 聽::nRowi2:=nOldRow2+(nRow-nOldRow)
聽 聽::nColi2:=nOldCol2+(nCol-nOldCol)
聽 聽::DibLine()
聽 聽::nItePre:=ASCAN(::aitems,{ |val| val[1] <= nRow .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 val[2] <= ncol .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 val[4] >= ncol .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 val[3] >= nRow }) 
聽 聽 if ::nitepre!=0
聽 聽 聽 聽 Cursor("CURSOR_1")
聽 聽 else
// 聽 聽 聽 聽Super:MouseMove( nRow, nCol, nKeyFlags ) 
聽 聽 聽 聽 cursorarrow()
聽 聽 endif
聽 聽 ReTurn 0
endif
聽 聽::nItem:=ASCAN(::aitems,{ |val| val[1] <= nRow .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽val[2] <= ncol .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽val[4]+5 >= ncol .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽val[3] >= nRow }) 
聽 聽if ::lcaptured
聽 聽 聽if ::nItem = 0
聽 聽 聽 聽 聽CURSOR("CURSOR_1")
聽 聽 聽 聽 聽::lCaptured:=.f.
聽 聽 聽 聽 聽::lCaptuPre:=.t.
聽 聽 聽endif
聽 聽endif

聽 聽if ::nItem !=0
聽 聽 聽 if ::aitems[::nitem][2] <= ncol .and. ::aitems[::nitem][2]+2 >=ncol
聽 聽 聽 聽 聽CURSOR("CURSOR_3")
// 聽 聽 聽 聽 Cursorwe()
聽 聽 聽 elseif ::aitems[::nitem][4]-3 <= ncol .and. ::aitems[::nitem][4] >=ncol
聽 聽 聽 聽 聽CURSOR("CURSOR_2")
// 聽 聽 聽 聽 Cursorwe()
聽 聽 聽 elseif ::aitems[::nitem][4]+2 <= ncol .and. ::aitems[::nitem][4]+5 >= ncol
聽 聽 聽 聽 聽Cursor("CURSOR_1") //cadema
聽 聽 聽 elseif ::aitems[::nitem][2] < ncol+2 .and. ::aitems[::nitem][4]-3 > ncol
聽 聽 聽 聽 聽CURSOR("CURSOR_4") //mover
聽 聽 聽 else
聽 聽 聽 聽 聽Cursorarrow()
// 聽 聽 聽 聽Super:MouseMove( nRow, nCol, nKeyFlags ) 
聽 聽 聽 endif

聽 聽 聽 IF ::bTrovaTip # nil
聽 聽 聽 聽 聽eval(::bTrovaTip,self)
聽 聽 聽 聽 聽IF ! empty(::cToolTip)
聽 聽 聽 聽 聽 聽 ::ltooltipBallon:=.t.
聽 聽 聽 聽 聽 聽 ::ntooltipwidth:=600
聽 聽 聽 聽 聽 聽 ::ntooltipTexColor:=RGB(0,0,0) //RGB(255,255,255)
聽 聽 聽 聽 聽 聽 ::ntooltipBkColor:=RGB(58,116,241) 聽//ColorPan() //
聽 聽 聽 聽 聽 聽 ::ntooltipIcon:=0
聽 聽 聽 聽 聽 聽 ::ShowToolTip( nRow, nCol,::cToolTip )
聽 聽 聽 聽 聽ENDIF
聽 聽 聽 ENDIF

聽 聽else

聽 聽 聽 If ::bTrovaTip # nil
聽 聽 聽 聽 聽::DestroyToolTip()
聽 聽 聽 Endif
聽 聽 聽 聽 聽Cursorarrow()
// 聽 聽 聽Super:MouseMove( nRow, nCol, nKeyFlags ) 
聽 聽endif

Return 0
//---------------------------------------------------------//
METHOD LButtonDown( nRow, nCol, nKeyFlags ) CLASS TGantt
if ::bLbx!=NIL
聽 聽::Blbx:LbuttonDown( nRow+32, 40, nKeyFlags )
endif
::GetDC()
nOldCol:=nCol
nOldRow:=nRow
::nitem:=ASCAN(::aitems,{ |val| val[1] <= nRow .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 val[2] <= ncol .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 val[4]+5 >= ncol .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 val[3] >= nRow }) 

聽 聽if ::nitem !=0
聽 聽 聽 聽 聽::holdpen:=Selectobject(::hDC,::hTrazoPen)
聽 聽 聽 if ::aitems[::nitem][2] <= ncol .and. ::aitems[::nitem][2]+2 >=ncol
聽 聽 聽 聽 聽::lCaptured:=.t.
聽 聽 聽 聽 聽::nRow1=::aitems[::nitem][1] -2
聽 聽 聽 聽 聽::nCol1=::aitems[::nitem][2] 
聽 聽 聽 聽 聽::nCol2=::aitems[::nitem][4] 
聽 聽 聽 聽 聽::nrow2=::aitems[::nitem][3] +1
聽 聽 聽 聽 聽::nLcol:=.t.
聽 聽 聽 聽 聽::nRcol:=.f.
聽 聽 聽 聽 聽nOldCol1:=::nCol1
聽 聽 聽 聽 聽nOldCol2:=::nCol2
聽 聽 聽 聽 聽::DibRect()
聽 聽 聽 聽 聽CURSOR("CURSOR_3")
聽 聽 聽 elseif ::aitems[::nitem][4]-3 <= ncol .and. ::aitems[::nitem][4]>=ncol
聽 聽 聽 聽 聽::lCaptured:=.t.
聽 聽 聽 聽 聽::nRow1=::aitems[::nitem][1] -2
聽 聽 聽 聽 聽::nCol1=::aitems[::nitem][2] 
聽 聽 聽 聽 聽::nCol2=::aitems[::nitem][4] 
聽 聽 聽 聽 聽::nrow2=::aitems[::nitem][3] +1
聽 聽 聽 聽 聽::nLcol:=.f.
聽 聽 聽 聽 聽::nRcol:=.t.
聽 聽 聽 聽 聽nOldCol1:=::nCol1
聽 聽 聽 聽 聽nOldCol2:=::nCol2
聽 聽 聽 聽 聽::DibRect()
聽 聽 聽 聽 聽CURSOR("CURSOR_2")
聽 聽 聽 elseif ::aitems[::nitem][4]+2 <= ncol .and. ::aitems[::nitem][4]+5 > ncol
聽 聽 聽 聽 聽::lCaptured:=.f.
聽 聽 聽 聽 聽::lCaptuPre:=.t.
聽 聽 聽 聽 聽::nRowi1=nRow 
聽 聽 聽 聽 聽::nColi1=nCol 
聽 聽 聽 聽 聽::nColi2=nCol 
聽 聽 聽 聽 聽::nrowi2=nRow 
聽 聽 聽 聽 聽nOldRow2:=nRow
聽 聽 聽 聽 聽nOldCol2:=nCol
聽 聽 聽 聽 聽::DibLine()
聽 聽 聽 聽 聽Cursor("CURSOR_1")
聽 聽 聽 elseif ::aitems[::nitem][2] < ncol+2 .and. ::aitems[::nitem][4]-3 > ncol
聽 聽 聽 聽 聽::lCaptured:=.t.
聽 聽 聽 聽 聽::nRow1=::aitems[::nitem][1] -2
聽 聽 聽 聽 聽::nCol1=::aitems[::nitem][2] 
聽 聽 聽 聽 聽::nCol2=::aitems[::nitem][4] 
聽 聽 聽 聽 聽::nrow2=::aitems[::nitem][3] +1
聽 聽 聽 聽 聽::nLcol:=.t.
聽 聽 聽 聽 聽::nRcol:=.t.
聽 聽 聽 聽 聽nOldCol1:=::nCol1
聽 聽 聽 聽 聽nOldCol2:=::nCol2
聽 聽 聽 聽 聽::DibRect()
聽 聽 聽 聽 聽CURSOR("CURSOR_4")
聽 聽 聽 endif
聽 聽endif
聽 聽 聽 聽
RETURN Super:LButtonDown( nRow, nCol, nKeyFlags )
//------------------------------------------------------//
METHOD LButtonUp( nRow, nCol, nKeyFlags ) 聽CLASS TGantt
聽 聽::DestroyToolTip()
if ::lCaptured
聽 聽::DibRect()
聽 聽selectObject(::hDC,::hOldPen)
聽 聽::ReleaseDC()
聽 聽::lCaptuPre:=.f.
聽 聽::lCaptured:=.f.
聽 聽 if nOldCol1!=::nCol1 .or. ;
聽 聽 聽 聽nOldCol2!=::nCol2
聽 聽 聽 if ::bchange != NIL
聽 聽 聽 聽 聽eval(::bChange,Self)
聽 聽 聽 endif
聽 聽endif
endif
if ::lCaptuPre
聽 聽::DibLine()
聽 聽selectObject(::hDC,::hOldPen)
聽 聽::ReleaseDC()
聽 聽::lCaptured:=.f.
聽 聽::lCaptuPre:=.f.
聽 聽if ::nitepre !=0 .and. ::nItem != 0
聽 聽if ::nitepre != ::nItem 
聽 聽if ::bPresed != NIL
聽 聽 聽 eval(::bPresed,Self)
聽 聽endif
聽 endif
聽 endif
聽 ::nItePre:=0
endif
/*
聽 聽 聽 IF ::bInizioFine # nil
聽 聽 聽 聽 聽::DestroyToolTip()
聽 聽 聽 endif
*/
Return Super:LButtonUp( nRow, nCol, nKeyFlags )
//----------------------------------------------------------------------------//
METHOD DibRect() CLASS TGantt
::iRop:=ClsetroP2(::hDC, 7)
聽 聽 聽 聽 聽 聽MoveTo( ::hDC, ::nCol1,::nRow1 聽)
聽 聽 聽 聽 聽 聽LineTo( ::hDC, ::nCol2,::nRow1 )
聽 聽 聽 聽 聽 聽LineTo( ::hDC, ::nCol2,::nRow2 )
聽 聽 聽 聽 聽 聽LineTo( ::hDC, ::nCol1,::nRow2 )
聽 聽 聽 聽 聽 聽LineTo( ::hDC, ::nCol1,::nRow1 )
ClseTroP2(::hDC,::iRop)
RETURN NIL
//----------------------------//
METHOD DibLine() CLASS TGantt
聽 聽::iRop:=ClsetroP2(::hDC, 7)
聽 聽 聽 聽 聽 聽MoveTo( ::hDC, ::nColi1,::nRowi1 聽)
聽 聽 聽 聽 聽 聽LineTo( ::hDC, ::nColi2,::nRowi2 )
聽 聽ClseTroP2(::hDC,::iRop)
RETURN NIL
//-----------------------------//
METHOD End() CLASS TGantt
聽 聽deleteobject(::hTrazoPen)
聽 聽Super:End()
RETURN NIL
//--------------------------------------//
METHOD LDblClick( nRow, nCol, nKeyFlags ) 
聽 聽::lCaptured:=.f.
聽 聽::lCaptuPre:=.f.
聽 聽if ::bLbx!=NIL
聽 聽 聽 ::blbx:LDblClick( nRow, nCol, nKeyFlags ) 
聽 聽endif
聽 聽Super:LDblClick( nRow, nCol, nKeyFlags ) 聽 聽
Return NIL
//-----------------------------------------------------//
METHOD _FillRect (aCols, oBrush,barra) CLASS TGantt
聽 聽Local nBar := if( barra = nil, 0, barra)
聽 聽::GetDC()
聽 聽 聽 FillRect(::hDC ,aCols, oBrush:hBrush)
聽 聽::ReleaseDC()
聽 聽if nbar > 0 
聽 聽 聽 if len(::aitems) >= nBar
聽 聽 聽 聽 聽::aitems[nbar]:={aCols[1],aCols[2],aCols[3],aCols[4]}
聽 聽 聽 else
聽 聽 聽 聽 聽AADD( ::aitems,{aCols[1],aCols[2],aCols[3],aCols[4]} )
聽 聽 聽 endif
聽 聽endif
return NIL


gantt.ch
Code (fw): Select all Collapse
//----------------------------------------------------------------------------//
// GANTT

#xcommand @ <nRow>, <nCol> GANTT [<oGantt>] ;
聽 聽 聽 聽 聽 聽 聽[ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
聽 聽 聽 聽 聽 聽 聽[ SIZE <nWidth>, <nHeight> ] ;
聽 聽 聽 聽 聽 聽 聽[ <border: BORDER>] ;
聽 聽 聽 聽 聽 聽 聽[ <vScroll: VSCROLL, VERTICAL SCROLL> ] ;
聽 聽 聽 聽 聽 聽 聽[ <hScroll: HSCROLL, HORIZONTAL SCROLL> ] ;
聽 聽 聽 聽 聽 聽 聽[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
聽 聽 聽 聽 聽 聽 聽[ 聽ON CHANGE <uChange> ] ;
聽 聽 聽 聽 聽 聽 聽[ 聽ON PRESED <uPresed> ] ;
聽 聽 聽 聽 聽 聽 聽[ 聽BOXLIS <uLbx> ] ;
聽 聽 聽 聽=> ;
聽 聽 聽 聽 聽 [<oGantt> := ] TGantt():New( <nRow>, <nCol>, <nWidth>, <nHeight>, <oWnd>,;
聽 聽 聽 聽 聽 聽 聽<.border.>, [<.vScroll.>], [<.hScroll.>], <nClrFore>,;
聽 聽 聽 聽 聽 聽 聽<nClrBack>,[<{uChange}>],[<{uPresed}>],<uLbx> )

#xcommand REDEFINE GANTT [<oGantt>] ;
聽 聽 聽 聽 聽 聽 聽[ ID <nId> ] ;
聽 聽 聽 聽 聽 聽 聽[ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
聽 聽 聽 聽 聽 聽 聽[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
聽 聽 聽 聽=> ;
聽 聽 聽 聽 聽 [ <oGantt> := ] TGantt():Redefine( <nId>, <oWnd>,;
聽 聽 聽 聽 聽 聽 聽<nClrFore>, <nClrBack> )


This function is required:
Code (fw): Select all Collapse
#include <windows.h>
#include <hbapi.h>

HB_FUNC( CLSETROP2 ) // ( hDll, Ctex )
{
聽 聽hb_retni( 聽SetROP2( ( HDC ) hb_parnl( 1 ), hb_parni( 2 ) ) );
}


We have not testet it yet, so your feedback about it is welcome :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com