CLASS modification

CLASS modification

Postby Otto » Tue May 23, 2023 7:47 am

Dear Antonio,

This question from Jimmy is very important for me.
We need a blueprint for this.

Hi Antonio,

How do I use those modifications with CLASS TCalendar()?

Do I make a copy of tcalenda.prg and include it in my App, or do I create a new CLASS FROM, or how do I build a new LIB with modified Source?



For example, I asked ChatGPT about horizontally scrolling in a TScrollPanel.

Here is the answer, and I would like to try a solution.



Thank you for providing the second part of the TScrollPanel class definition.
The methods in this part of the class definition are primarily involved with the vertical scrolling behavior of the panel, such as moving up and down,
going to a specific position, handling vertical scroll events, and painting the panel's contents.


As with the previous part of the class, there are no methods that explicitly handle horizontal scrolling.
The steps to add horizontal scrolling would still be similar to what I described before:

Define a horizontal scrollbar in addition to the vertical one.
This would be similar to the line
DEFINE SCROLLBAR ::oVScroll VERTICAL OF Self RANGE 1,2, but with HORIZONTAL instead of VERTICAL.

Adjust the SetRange() method to set the range of the horizontal scrollbar based on the width of the contents of the panel.

Handle the scroll event of the horizontal scrollbar to adjust the visible part of the panel's contents.

To apply these steps to your code, you would likely need to create new methods similar to the existing methods for vertical scrolling,
but adjusted for horizontal movement instead. This could include methods like hSetPos() for setting the horizontal scrollbar position,
ScrollHorizontallyBy() for scrolling a certain number of pixels horizontally, GoLeft() and GoRight() for moving left and right, HScroll() for handling horizontal scroll events, and so on.

Please note that these are general recommendations and the specific implementation would depend on the details of your application and the FiveTech library.
It would likely require a good understanding of the library and possibly some trial and error to get it working correctly.
It might be best to reach out to the FiveTech community or their support for specific guidance on how to implement this.






But changing the class??

Inheriting or extending the class and then experimenting in your own prg, I think, would be one way.
Copy the original functions from the class, then rename them and see what happens.

Best regards,
Otto"
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: CLASS modification

Postby Silvio.Falconi » Tue May 23, 2023 9:40 am

chagpt not Know Harbour clipper fivewin , perhaps only Minigui

I tried many functions but it always gave me minigui code or code that looks like fivewin and harbur but in reality it's not and every time you have to tell it "I don't know this class" or "this function doesn't exist"


for a sample I ask this

can you create me a function in harbor and fivewin that can display a perpetual calendar in a dialog ?

this is the result

Code: Select all  Expand view  RUN
#include "FiveWin.ch"

FUNCTION Calendar()
    LOCAL oDlg, oCal
    LOCAL nYear, nMonth

    // Creazione della finestra di dialogo
    oDlg := TDialog():New(nil, "Calendario", 20, 20, 200, 200, DWSYSMENU)

    // Creazione del calendario
    oCal := TCalendar():New(oDlg, 10, 10, 180, 160)

    // Funzione per visualizzare il calendario perpetuo
    oCal:OnDateSelected := { |nDate|
        nYear := Year(nDate)
        nMonth := Month(nDate)

        // Ottieni il giorno della settimana per il primo giorno del mese
        LOCAL nDayOfWeek := WeekDay(Date(nYear, nMonth, 1))

        // Ottieni il numero di giorni nel mese
        LOCAL nDaysInMonth := DaysInMonth(nYear, nMonth)

        // Pulisci il calendario
        oCal:Clear()

        // Imposta l'intestazione del calendario
        oCal:Title := PadL(MonthName(nMonth), 9) + " " + PadL(AllTrim(Str(nYear)), 4)

        // Imposta le etichette dei giorni della settimana
        oCal:SetDaysOfWeek({"Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"})

        // Aggiungi i numeri dei giorni nel calendario
        FOR i := 1 TO nDaysInMonth
            oCal:AddDay(i)
        NEXT i

        // Imposta le posizioni dei numeri dei giorni nel calendario
        FOR i := 1 TO nDayOfWeek - 1
            oCal:MoveDay(0, 1)
        NEXT i
    }

    // Visualizza la finestra di dialogo
    oDlg:Run()
RETURN NIL

PROCEDURE Main()
    Calendar()
RETURN
 

do you tried it to compile ?

alternatives to TCalendar are
1) msgcalc which is not professional
2) Nages' xbrgetdt that cannot be made smaller without losing the year's get


Also to me Chatgpt wrote this, when Not Know how resolve something

Code: Select all  Expand view  RUN
Please note that these are general recommendations and the specific implementation would depend on the details of your application and the FiveTech library.
It would likely require a good understanding of the library and possibly some trial and error to get it working correctly.
It might be best to reach out to the FiveTech community or their support for specific guidance on how to implement this.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: CLASS modification

Postby Otto » Tue May 23, 2023 11:49 am

Silvio,

Have you provided the classes and manual to ChatCPT?

This is important.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: CLASS modification

Postby karinha » Tue May 23, 2023 12:50 pm

Silvio, DWSYSMENU??

Thanks.

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

Re: CLASS modification

Postby karinha » Tue May 23, 2023 1:01 pm

Que tal?

https://imgur.com/nplXTwC

Image

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

Re: CLASS modification

Postby Marc Venken » Tue May 23, 2023 1:54 pm

Nice Calendar....
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: CLASS modification

Postby karinha » Tue May 23, 2023 5:24 pm

Marc Venken wrote:Nice Calendar....


Download Complete:

https://mega.nz/file/cIcwEBaZ#E3PhxjP_GekUMwgN2rOYWN0c00bogblM4WLymsU4fJ8

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

Re: CLASS modification

Postby Antonio Linares » Tue May 23, 2023 5:38 pm

Dear Otto,

> Do I make a copy of tcalenda.prg and include it in my App

Usually this is the best way
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: CLASS modification

Postby Marc Venken » Tue May 23, 2023 6:43 pm

karinha wrote:
Marc Venken wrote:Nice Calendar....


Download Complete:

https://mega.nz/file/cIcwEBaZ#E3PhxjP_GekUMwgN2rOYWN0c00bogblM4WLymsU4fJ8

Regards, saludos.


Thank you !!
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: CLASS modification

Postby Silvio.Falconi » Wed May 24, 2023 4:16 am

I Wish calendar as datepick where the finale user can select year, mourh etc .
Why i mudt change my oldest applications onlyvehen i must recompilre It for modifications?
It Is not right
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: CLASS modification

Postby Jimmy » Wed May 24, 2023 6:09 am

hi Silvio,
Silvio.Falconi wrote:I Wish calendar as datepick where the finale user can select year, mourh etc .
Why i mudt change my oldest applications onlyvehen i must recompilre It for modifications?
It Is not right

Calendar is "SysMonthCal32"
https://learn.microsoft.com/en-us/windo ... ar-control
https://learn.microsoft.com/en-us/windo ... -reference

Datepicker is "SysDateTimePick32"
https://learn.microsoft.com/en-us/windo ... er-control
https://learn.microsoft.com/en-us/windo ... -reference

Difference : Datepicker can show only 1 Month
but you can change Month / Year in "Header"

you can use Calendar as "Date Picker" when set dDate1 = dDate2
but while it have "Start-Date" and "End-Date" you need LbDown / LbUp and not DblClick which will "destroy marker"
Image
when include last Modification, which you have found out, both work now

DblClick -> Array(dDate1,dDate2) where dDate1 = dDate2
Ctrl+ (End) click -> mark "Start" to "End" where dDate1 <>,dDate2
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: CLASS modification

Postby Antonio Linares » Wed May 24, 2023 7:55 am

Dear Jimmy,

> when include last Modification, which you have found out, both work now

What modification is it ? thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: CLASS modification

Postby Silvio.Falconi » Wed May 24, 2023 8:06 am

Jimmy wrote:hi Silvio,
Silvio.Falconi wrote:I Wish calendar as datepick where the finale user can select year, mourh etc .
Why i mudt change my oldest applications onlyvehen i must recompilre It for modifications?
It Is not right

Calendar is "SysMonthCal32"
https://learn.microsoft.com/en-us/windo ... ar-control
https://learn.microsoft.com/en-us/windo ... -reference

Datepicker is "SysDateTimePick32"
https://learn.microsoft.com/en-us/windo ... er-control
https://learn.microsoft.com/en-us/windo ... -reference

Difference : Datepicker can show only 1 Month
but you can change Month / Year in "Header"

you can use Calendar as "Date Picker" when set dDate1 = dDate2
but while it have "Start-Date" and "End-Date" you need LbDown / LbUp and not DblClick which will "destroy marker"
Image
when include last Modification, which you have found out, both work now

DblClick -> Array(dDate1,dDate2) where dDate1 = dDate2
Ctrl+ (End) click -> mark "Start" to "End" where dDate1 <>,dDate2




Sorry, I still don't understand, I'll be slow on the uptake.

Read carefully what I write to you

I have an old application that I've been using for many years at school where I have a get (action) control that opens a calendar (Tcalendar class) in a dialog (popup) and the user selects the date.

Now it happened that I had to modify some procedures of that program and I went to recompile and that get while loading the calendar (Tcalendar) doesn't make doubleclick work so it's unusable.

I have to read bullshit or meaningless sentences on the forum, I don't want to use other procedures, I want a calendar like Tcalendar .
I know well the differences between SysDateTimePick32 and SysMonthCal32. with Tcalendar you could select the months and years in a perpetual way and the same thing does datepick unless you have admitted a range of dates


I want this ( opened on a dialog popup and the user can select the date)

Image

Image

Image

I don't ask for the moon!!!

I just ask you to restore my old software, I don't understand why I have to change everything, because the selection of the date is in almost all the program procedures.


Tcaledar Modifications
the latest modifications on the Tcaledar class suggested by Cristobal work, ie the user can select a date through the doubleclick system.

But the Tcalendar doesn't work ie the end user can't view the months and years

logically the IsOverDay() function is wrong as I can't find this function determines that the mouse is on the prompt of the days or in other areas.

if you hover the mouse over the name of the month or over the year it is not highlighted !!!

while if you click on the black arrows you can change the month before and after

so it's the Isoverday function that determines where the mouse is positioned

so you have to change this function to isoverday


Code: Select all  Expand view  RUN
HB_FUNC( ISOVERDAY )
{
   #ifndef _WIN64
      HWND hwndMC = ( HWND ) hb_parnl( 1 );
   #else
      HWND hwndMC = ( HWND ) hb_parnll( 1 );
   #endif
   PMCHITTESTINFO pMCHitTest = ( PMCHITTESTINFO ) hb_xgrab( sizeof ( MCHITTESTINFO ) ) ;
   BOOL lOver;
   
   memset( pMCHitTest, 0, sizeof( MCHITTESTINFO ) );
   
   pMCHitTest->cbSize = sizeof( MCHITTESTINFO );
   pMCHitTest->pt.y = hb_parnl( 2 );
   pMCHitTest->pt.x = hb_parnl( 3 );
   
   lOver = ( MonthCal_HitTest( hwndMC, pMCHitTest ) == MCHT_CALENDARDATE );
   
   hb_xfree( pMCHitTest );
   
   hb_retl( lOver );
}



This function determines whether a given point (x, y) on a month calendar control is over a specific day or not.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: CLASS modification

Postby Otto » Wed May 24, 2023 9:05 am

Silvio, As you are one of the young people here in our group, technology and especially your users will soon force you into the web.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: CLASS modification

Postby Silvio.Falconi » Wed May 24, 2023 9:42 am

Otto wrote:Silvio, As you are one of the young people here in our group, technology and especially your users will soon force you into the web.

Best regards,
Otto


Otto,
I'm not the youngest of your group, I use fivewin from version 14.4 (1992) maybe you are the youngest in fact I don't remember you in the famous outlook newsgroups!!!!
My users will never go on the web with my applications and I have already explained to you several times why
I see no need to create web applications when windows applications and especially basic procedures are not correct
You who make Web applications, can you do everything in Windows system?
I don't think so... there are many things that still don't work properly or you don't care

and I'm not young I'm 57 years of age and in 5 years I'm retiring as a teacher and I don't think I'll make applications in windows but I'll take care of gardening, grandchildren until the last day of my old age
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 84 guests