Author | Topic: Codejock datepicker and events | |
---|---|---|
Sebastiaan | Codejock datepicker and events on Wed, 18 Feb 2009 12:53:00 +0100 I'm having a problem using the Codejock ActiveX Library. But I'm not sure the problem is in the ActiveX component. Because some of you are also using this library I'm wondering if you had similar problems. My specific problem is with the DatePicker control. This control has an event called DayMetrics, which is triggered before the paint of every day in the current view. The event is disabled by default, meaning the event is not posted (not that the event just isn't handled), and can be enabled by setting AskDayMetrics to true. The problem is that as soon as you set AskDayMetrics to true, the whole ActiveXControl (I'm using an XpbActiveXControl) and (therefore?) the whole application is getting VERY slow. Naturally this depends on the number of days on display, I am displaying a whole year which means the event is posted 365 times, so you would expect some delays, but its far slower then I would expect. Calling :suspendEvent() before showing the control changes nothing, so I wasn't expecting the problem to be an Alaska thing because the events should be ignored. However, the same control works perfectly in a Visual Basic application, You can even swith to a view of 3 years and draw each day in a different font without any visible delay. Also see the Codejock sample that can be downloaded from their website. I'm a bit lost now, because I would expect that Xbase for some reason delays the events, but the strange thing is that the control also has a MouseMove event which is always fired, and this causes no delay at all. The only difference is that this is posted to the default Move event, executing the standard :Move block. Also assigning a codeblock to the DayMetrics event makes no difference at all. Has ayone ever experienced something like this, or can anyone explain why drawing is delayed when the events are posted, or is this just a problem in the ActiveX control? Or is there a difference between handling standard and custom events, maybe because the event is passing two objects? I have posted a sample PRG file and a sample project and EXE in the ZIP file. The libray can be downloaded from http://www.codejock.com/downloads/ We tested and build this with Alaska version 1.90.331 and 1.90.350 (SL1) on both Windows XP and Vista machines. Hope anyone has an idea. Thanks, Sebastiaan cj_events.prg cj_events.zip | |
AUGE_OHR | Re: Codejock datepicker and events on Thu, 19 Feb 2009 01:18:59 +0100 hi, > I'm having a problem using the Codejock ActiveX Library. > > My specific problem is with the DatePicker control. > This control has an event called DayMetrics, which is triggered before > the paint of every day in the current view. we are talking about Codejock Suite Controls ActiveX Control v13.0 ? if yes you meen DateTimePicker Control ? if yes : where do you find Event DayMetrics ? where do you got Property :ColumnCount and RowCount from ? i knew MsCal.OCX and MsComCt2.OCX so i know what they meen, but they are not (documented) Part of Codejock. with DayMetrics i think you meen DayBold, right ? > The event is disabled by default, meaning the event is not posted (not > that the event just isn't handled), and can be enabled by setting > AskDayMetrics to true. > > The problem is that as soon as you set AskDayMetrics to true, the whole > ActiveXControl (I'm using an XpbActiveXControl) and (therefore?) the > whole application is getting VERY slow. > > Naturally this depends on the number of days on display, I am displaying > a whole year which means the event is posted 365 times, so you would > expect some delays, but its far slower then I would expect. if you had try Alaska Sample Datepicker using MsComCT2.OCX you woud know that every DayBold have to be "paint". please search for Discussion with Alaska while Xbase++ is not able to "paint" it direct if you do it 365 times it will take some time ... but WHY do you need 365 ? i just need it for Weekend and Holydays etc. > Calling :suspendEvent() before showing the control changes nothing, this is while Xbase++ ignore Daybold > However, the same control works perfectly in a Visual Basic application, you can say same if you use a "other" X-Compiler > I'm a bit lost now, because I would expect that Xbase for some reason > delays the events, but the strange thing is that the control also has a > MouseMove event which is always fired, and this causes no delay at all. as i say Xbase++ ignore Daybold, but you can get it work with YUKON. YUKON also show how Daybold is "define" (some 8bit Registry ...) and how to "set flag" so Day become bold. this "calculation" take much time and result will only show at end of all 365 Days. i guess Codejock will do same (undocumented) futures. please ask in Codejock Forum for it. so what can you do: 1.) did you try Codejock MonthCalendar Control ? 2.) "paint" you own "Daybold" btw. DateTime is YYYYMMDDHHMMSS, but Xbase++ Date and Time is different. use oActiveX:treatDateAsString(.T.) and you can use a String oDlg:oMonthView:treatDateAsString(.T.) oDlg:oMonthView:setProperty("DayBold", "20080907080000") 3.) what about Codejock Calender ? other Question : Did you try more Codejock Component ? do you like to joint Xbase++ Project to make Codejock "Wrapper" ? greetings by OHR Jimmy | |
Sebastiaan | Re: Codejock datepicker and events on Thu, 19 Feb 2009 09:24:36 +0100 AUGE_OHR wrote: > hi, > we are talking about Codejock Suite Controls ActiveX Control v13.0 ? > if yes you meen DateTimePicker Control ? > > if yes : where do you find Event DayMetrics ? > where do you got Property :ColumnCount and RowCount from ? > > i knew MsCal.OCX and MsComCt2.OCX so i know what they meen, > but they are not (documented) Part of Codejock. > > with DayMetrics i think you meen DayBold, right ? > First of all, thanks for looking into this. But I'm talking about the 'Xtreme Calendar' Control which has a DatePicker control, the "Codejock.DatePicker.13.0.0". Which has all of the above properties. > if you had try Alaska Sample Datepicker using MsComCT2.OCX you > woud know that every DayBold have to be "paint". please search for > Discussion with Alaska while Xbase++ is not able to "paint" it direct > > if you do it 365 times it will take some time ... but WHY do you need 365 ? > i just need it for Weekend and Holydays etc. > The description of the event is the following: ------- Occurs before the each date\day is drawn in the Date Picker. This allows the metrics to be modified before the day is displayed. ----- Parameters Day Date that will be drawn next. Metrics Metrics for the next day hat will be drawn. So it is not so much a question of why to draw them, they need to be drawn anyway, this event just allows you the change the "Metrics" object, which contains the font, the background and foreground color for the day to be drawn. At the moment I'm not even changing any of this, I simply ask for the event to be fired. Eventually I'm hoping to use this to display a holiday/sick days calendar. This way I can display the holiday weeks /sick days etc. in a different color. I'm using this datepicker control because it allows you to very easily select multiple date periods and apply colors/fonts etc. So we really need to be able to display a whole year to make this useful to the user, so I don't think there is a way to avoid painting 365 days. The problem really just is that as soon as you set AskDayMetrics to true, the whole thing is frustratingly slow. And I still am unsure if this is because Xbase somehow can't handle these events fast enough (which I suspect) or just a fault in the codejock library( which I doubt, because it works in other environments). > > so what can you do: > 1.) did you try Codejock MonthCalendar Control ? > 2.) "paint" you own "Daybold" > 3.) what about Codejock Calender ? 1) No I did not. At first I thought I could only use this to display only one month. But it looks like this is usable, however I don't think I can display date selections in multiple colors using this control. But I will take another look at it. 2) See above. 3) See above. By the way, we are planning to eventually use the whole Calendar control to display certain tasks on working days. But for now I'm just focusing on this part. But maybe I will look into displaying a more compact calendar to get about the same effect as the datepicker. > other Question : Did you try more Codejock Component ? Not yet. We (and at the moment just me) are just testing these controls since this week. We want to buy them, but we're still testing them. So far I really like what you get. It's just a bit frustrating to run into problems this fast. Which makes it harder to decide where to go with this. > do you like to joint Xbase++ Project to make Codejock "Wrapper" ? As said above, I can't answer you last question (yet). We need to evaluate the controls a bit more. But I'm interested to hear what your plans are. > greetings by OHR > Jimmy > Greetings, Sebastiaan | |
AUGE_OHR | Re: Codejock datepicker and events on Thu, 19 Feb 2009 09:39:26 +0100 hi, > But I'm talking about the 'Xtreme Calendar' Control which has a > DatePicker control, the "Codejock.DatePicker.13.0.0". > Which has all of the above properties. funny, it is not in my Help File (see picture) ... and Yes Xbase++ activex is slow ... greetings by OHR Jimmy CJ_DatePicker.JPG | |
Sebastiaan | Re: Codejock datepicker and events on Thu, 19 Feb 2009 09:51:58 +0100 AUGE_OHR wrote: > hi, > >> But I'm talking about the 'Xtreme Calendar' Control which has a >> DatePicker control, the "Codejock.DatePicker.13.0.0". >> Which has all of the above properties. > > funny, it is not in my Help File (see picture) > ... and Yes Xbase++ activex is slow ... > > greetings by OHR > Jimmy > > The control you show is under Xtreme Suite Controls > DateTIMEPicker (note the TIME) The control I'm using is under Xtreme Calendar > Objects > DatePicker Control (no TIME) And I still don't get why events like mouse moves (which are a LOT of events) don't look slow. | |
AUGE_OHR | Re: Codejock datepicker and events on Thu, 19 Feb 2009 09:51:48 +0100 hi, > 'Calendar' Control which has a DatePicker control, the > "Codejock.DatePicker.13.0.0" ok, now i got it . there is a Xtreme Calendar ActiveX Control v13.0 DatePicker Control and a Xtreme Suite Controls ActiveX Control v13.0 DateTimePicker Control thats why i allways use a CLSID ... greetings by OHR Jimmy | |
AUGE_OHR | Re: Codejock datepicker and events on Thu, 19 Feb 2009 09:57:39 +0100 hi, >> 3.) what about Codejock Calender ? > > 3) See above. By the way, we are planning to eventually use the whole > Calendar control to display certain tasks on working days. But for now I'm > just focusing on this part. But maybe I will look into displaying a more > compact calendar to get about the same effect as the datepicker. we allready got Wrapper for CJ Calender and DoXXXX Dataprovider to use own DBF. We are working on multi Resources and "buildin" Dialog which you canot not access yet with SL1 v350, so you must use your own Entry Screen. as i say join the XCodejock Project at Rogers Site. greetings by OHR Jimmy |