Page 2 of 3

Re: [Module] Calendar - Module (all OS)

Posted: Sat Jul 20, 2019 12:09 pm
by blueb
Thanks for the quick fix Thorsten.



PS - Happy belated birthday (July 18th)

Code: Select all

Calendar::AddEntry(#Calendar, "Thorsten", "Birthday", "", "", Calendar::GetDate(18, 7, 2019))
:mrgreen:

Re: [Module] Calendar - Module (all OS)

Posted: Tue Sep 03, 2019 5:27 pm
by Thorsten1867
Update: dynamic text size (needs ModuleEx.pbi)

Re: [Module] Calendar - Module (all OS)

Posted: Fri Nov 22, 2019 11:13 am
by Cyllceaux
Hey there...

Line 87/88... I use them from another source.


Can't use it in ContainerEx, cause of ToolTip :(

Next thing

Code: Select all

	Calendar::AddEntry(calTermine,"CD1","CD1","","",Calendar::GetDate(2019,11,22,8),Calendar::GetDate(2019,11,22,9)); don't work
	Calendar::AddEntry(calTermine,"CD2","CD2","","",Calendar::GetDate(2019,11,22,12),Calendar::GetDate(2019,11,22,13)); don't work

	Calendar::AddEntry(calTermine,"D1","D1","","",Date(2019,11,22,8,0,0),Date(2019,11,22,9,0,0));  work
	Calendar::AddEntry(calTermine,"D2","D2","","",Date(2019,11,22,12,0,0),Date(2019,11,22,13,0,0));  work

Re: [Module] Calendar - Module (all OS)

Posted: Fri Nov 22, 2019 2:19 pm
by Cyllceaux
Oh... A ClearEntries would be nice :)

Re: [Module] Calendar - Module (all OS)

Posted: Fri Nov 22, 2019 3:18 pm
by Thorsten1867
Update: Calendar::ClearEntries()

Re: [Module] Calendar - Module (all OS)

Posted: Sat Nov 23, 2019 5:29 am
by Cyllceaux
Line 87/88... I use them from another source.

Still there :(

Maybe:

Code: Select all

CompilerIf Not Defined(ToolTip, #PB_Module)
	XIncludeFile "CanvasTooltipModule.pbi"
CompilerEndIf


CompilerIf Not Defined(Date64, #PB_Module)
	XIncludeFile "Date64Module.pbi"
CompilerEndIf

Re: [Module] Calendar - Module (all OS)

Posted: Sat Nov 23, 2019 6:40 am
by BarryG
How can I copy this calendar module source? There's no single copy button, and Firefox crashes if I try to select and drag the source code (to copy it) because it's too big. Can't you zip it somewhere or something? Thanks.

Re: [Module] Calendar - Module (all OS)

Posted: Sat Nov 23, 2019 7:17 am
by Fangbeast
BarryG wrote:How can I copy this calendar module source? There's no single copy button, and Firefox crashes if I try to select and drag the source code (to copy it) because it's too big. Can't you zip it somewhere or something? Thanks.
Try this: https://github.com/Hoeppner1867/PureBasic

Re: [Module] Calendar - Module (all OS)

Posted: Sat Nov 23, 2019 7:45 am
by BarryG
Thanks, Fangbeast. Shame that I need to download 15 MB of files just to get the single Calendar.pbi file, though. Is that the way GitHub works? If so, that sucks.

Re: [Module] Calendar - Module (all OS)

Posted: Sat Nov 23, 2019 9:23 am
by Fangbeast
BarryG wrote:Thanks, Fangbeast. Shame that I need to download 15 MB of files just to get the single Calendar.pbi file, though. Is that the way GitHub works? If so, that sucks.
Don't really know why 15MB is a problem in this day and age and I'd rather have ALL the updated files at once as there is so much good code there.

But you can click on the folder containing the code and open each file in a separate tab. My download manager thinks it's a html page and can't seem to bypass it so I can view/copy/paste the contents into the IDE at least.

Oh, and make sure to hit the RAW button to remove the line numbers.

Re: [Module] Calendar - Module (all OS)

Posted: Sat Nov 23, 2019 9:47 am
by BarryG
Fangbeast wrote:Don't really know why 15MB is a problem
Size is not the issue; it's the principle. I dislike how GitHub makes me download the haystack just to get the needle.

Re: [Module] Calendar - Module (all OS)

Posted: Sat Nov 23, 2019 10:44 am
by Thorsten1867
I have changed the download link.
You don't have to "argue" anymore. :wink:

Re: [Module] Calendar - Module (all OS)

Posted: Sat Nov 23, 2019 3:19 pm
by Cyllceaux
#Description$ is same as #Summary$ is same as #Location$

Re: [Module] CalendarEx - Module (all OS)

Posted: Thu Nov 28, 2019 4:26 pm
by Thorsten1867
Update: Renamed to 'CalendarEx'

Re: [Module] CalendarEx - Gadget (all OS)

Posted: Thu Dec 23, 2021 4:54 pm
by nicolaus
Hi,

very nice Module thank you very much.
Unfortunataly some thing don't work as it should be.
If I run the file CalendarExModule.pbi with the included example, a added entry will not shown if you dont have a proper end date set.

For example:

Code: Select all

CalendarEx::AddEntry(#Calendar, "Thorsten", "Birthday","", "", CalendarEx::GetDate(18, 12, 2021)
This entry will mever shown because no end date is set.

Next issue I found is a entry what gose over a few day's, this ar also will never shown in your Module Example section.

And thze last thing is the entry what is created with the follow line of code

Code: Select all

CalendarEx::AddEntry(#Calendar, "Entry 2",  "2nd appointment", "", "", CalendarEx::GetDate(18, 12, 2021, 8), CalendarEx::GetDate(18, 12, 2021, 11, 15), CalendarEx::#Duration)
With this line you will have on each 18. of a month the same apointment added and not only at the 18.12.2021

This is the full module test code form your file with only changed date in entry

Code: Select all

;- ========  Module - Example ========

CompilerIf #PB_Compiler_IsMainFile
  
  #Example =1
  
  ; Example 1: Default 
  ; Example 2: #GreyedDays
  ;Example 3: Colors
  
  ;CalendarEx::DefaultCountry("DE")
  
  Enumeration 1
    #Window
    #Calendar
    #PopUpMenu
    #ExportEvent
    #ShowEntries
  EndEnumeration
  
  Enumeration 1
    #FontGadget
    #FontMonth
    #FontWeekDays
  EndEnumeration  
  
  LoadFont(#FontMonth,    "Arial", 11, #PB_Font_Bold)
  LoadFont(#FontWeekDays, "Arial",  9, #PB_Font_Bold)
  
  NewList Entries.CalendarEx::Entries_Structure()
  
  If OpenWindow(#Window, 0, 0, 300, 200, "Example", #PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
    
    If CreatePopupMenu(#PopUpMenu)
      MenuItem(#ExportEvent, "Export calendar entries")
      MenuBar()
      MenuItem(#ShowEntries, "Show calendar entries")
    EndIf
    
    If CalendarEx::Gadget(#Calendar, 10, 10, 280, 180, CalendarEx::#AutoResize, #Window) ; CalendarEx::#PostEvent|CalendarEx::#FixDayOfMonth|CalendarEx::#FixMonth|CalendarEx::#FixYear
      
      CalendarEx::AttachPopupMenu(#Calendar, #PopUpMenu)
      
      CalendarEx::SetFont(#Calendar, #FontMonth, CalendarEx::#Font_Month)
      CalendarEx::SetAttribute(#Calendar, CalendarEx::#Height_Month, 28)
      
      CalendarEx::SetFont(#Calendar, #FontWeekDays, CalendarEx::#Font_Weekdays)
      CalendarEx::SetAttribute(#Calendar, CalendarEx::#Height_WeekDays, 22)
      
      CalendarEx::UpdatePopupText(#Calendar, #ExportEvent, "Export calendar entries for '" + CalendarEx::#Date$ + "'.")
      CalendarEx::UpdatePopupText(#Calendar, #ShowEntries, "Show calendar entries for '"   + CalendarEx::#Date$ + "'.")
      
      CalendarEx::SetState(#Calendar, Date())

      CompilerIf Defined(ModuleEx, #PB_Module)
       
        CalendarEx::SetAutoResizeFlags(#Calendar, CalendarEx::#Width|CalendarEx::#Height|CalendarEx::#FitText)
    	  CalendarEx::SetDynamicFont(#Calendar, "Arial", 9)
    	  CalendarEx::FitText(#Calendar, 4, 4)
    	
      CompilerEndIf
      
      ;ModuleEx::SetTheme(ModuleEx::#Theme_DarkBlue)
      
      CompilerSelect #Example
        CompilerCase 2
          CalendarEx::SetFlags(#Calendar, CalendarEx::#Gadget, CalendarEx::#GreyedDays)
        CompilerCase 3
          CalendarEx::SetColor(#Calendar, CalendarEx::#Month_FrontColor, $FFF8F0)
          CalendarEx::SetColor(#Calendar, CalendarEx::#Month_BackColor,  $701919)
          CalendarEx::SetColor(#Calendar, CalendarEx::#Week_FrontColor,  $701919)
          CalendarEx::SetColor(#Calendar, CalendarEx::#Week_BackColor,   $FFFAF6)
          CalendarEx::SetColor(#Calendar, CalendarEx::#FocusColor,       $00FC7C)
          CalendarEx::SetColor(#Calendar, CalendarEx::#Entry_BackColor,  $9595FF)
          CalendarEx::SetFlags(#Calendar, CalendarEx::#Gadget, CalendarEx::#GreyedDays)
        CompilerDefault
          
          CalendarEx::SetColorTheme(#Calendar, CalendarEx::#Theme_Blue)
          
          CalendarEx::SetFont(#Calendar, #FontWeekDays, CalendarEx::#Font_Entry)
          CalendarEx::SetFlags(#Calendar, CalendarEx::#Gadget, CalendarEx::#GreyedDays)
          
          CalendarEx::SetMask(#Calendar, CalendarEx::#ToolTipText, CalendarEx::#Summary$ + ": " + CalendarEx::#Label$)
          CalendarEx::SetMask(#Calendar, CalendarEx::#Date, "%dd.%mm.%yyyy")
          
          CalendarEx::AddEntry(#Calendar, "Thorsten", "Birthday","", "", CalendarEx::GetDate(18, 12, 2021))

          CalendarEx::AddEntry(#Calendar, "Entry 2",  "2nd appointment", "", "", CalendarEx::GetDate(18, 12, 2021, 8), CalendarEx::GetDate(18, 12, 2021, 11, 15), CalendarEx::#Duration)
          CalendarEx::AddEntry(#Calendar, "Entry 3",  "3rd appointment", "", "", CalendarEx::GetDate(18, 12, 2021, 15, 30), #PB_Default, CalendarEx::#StartTime)

          CalendarEx::AddEntry(#Calendar,      "Holidy", "Holiday: Summer", "", "", CalendarEx::GetDate(27, 12, 2021), CalendarEx::GetDate(9, 1, 2022))
          CalendarEx::SetEntryColor(#Calendar, "Holidy", CalendarEx::#FrontColor, $008000)
          CalendarEx::SetEntryColor(#Calendar, "Holidy", CalendarEx::#BackColor,  $61FFC1)
          CalendarEx::SetEntryMask(#Calendar,  "Holidy",  "Holiday: " + CalendarEx::#StartDate$ + " - " + CalendarEx::#EndDate$)
          
      CompilerEndSelect
      
      ;CalendarEx::Disable(#Calendar)
      
    EndIf
    
    Repeat
      Event = WaitWindowEvent()
      Select Event
        Case CalendarEx::#Event_Gadget ;{ Module Events
          Select EventGadget()  
            Case #Calendar
              Select EventType()
                Case CalendarEx::#EventType_Month
                  ; 
                Case CalendarEx::#EventType_Year
                  
                Case CalendarEx::#EventType_Day
                  Debug "Day: " + Str(EventData())   
                Case CalendarEx::#EventType_Focus
                  Debug "Focus: " + Str(EventData()) 
            EndSelect
          EndSelect ;}
        Case #PB_Event_Menu          ;{ PopupMenu
          Select EventMenu()
            Case  #ExportEvent
              Debug "Export calendar entries: " + FormatDate("%dd/%mm/%yyyy",  CalendarEx::EventDate(#Calendar))
              DayOfMonth.i = CalendarEx::EventDayOfMonth(#Calendar)
              CalendarEx::ExportDay(#Calendar, DayOfMonth, "iCal_Export.ics")
            Case #ShowEntries  
              Debug "Show calendar entries: "
              CalendarEx::EventEntries(#Calendar, Entries())
              ForEach Entries()
                Debug "> " + FormatDate("%dd/%mm/%yyyy",  Entries()\StartDate) + ": " +  Entries()\Summary
              Next
          EndSelect ;}
        Case #PB_Event_Gadget  
          Select EventGadget()
            Case #Calendar           ;{ only in use with EventType()  
              Select EventType()
                Case CalendarEx::#EventType_Month
                  Debug "Select: Month"
                Case CalendarEx::#EventType_Year
                  Debug "Select: Year" 
              EndSelect ;}
          EndSelect  
      EndSelect        
    Until Event = #PB_Event_CloseWindow
    
    ;CalendarEx::SaveColorTheme(#Calendar, "Color.json")
    
    CloseWindow(#Window)
  EndIf 
  
CompilerEndIf



Can you please chgeck this issues?

Thank you and best regards,
Nico