XPages Time Edit Box - Set start time - time

It seems that since Fixpack 6 our edit boxes für setting a time value have changed a bit. If I use the time picker pop-up the selection always starts with 0:00. How can I set the first time to e.g. 8:00?
Could not see any option to set the start time in the properties list.

My best guess (without having FP6 currently at hand) is that it may have moved to a newer version of the TimeTextBox?
Looking at this ticket it seems that the previously used 'visibleRange' property of the constraints has been made obsolete by a new combination of 'pickerMin' and 'pickerMax' properties.
https://bugs.dojotoolkit.org/ticket/18220
The Extension library's 'constraints' complex property (xe:djDateTimeConstraints) has not been upgraded to support these new properties.
Although the Extension Library provides the 'XPages Control' for the Dojo Time Picker, it uses the dijit javascript files from the core domino dojo plugin, thus explaining why one might be upgraded without the other knowing about it.
While you wait for the ExtLib to be updated, perhaps there is a way to get a hold of the TimeTextBox 'dijit' and add the constraints programmatically after the dijit has been initialised.
something like this (note: I have not tested) in some sort of after page load event
dijit.byId('yourdijitsid').constraints.pickerMin = "T08:00:00";
dijit.byId('yourdijitsid').constraints.pickerMax = "T18:00:00";

Related

How to intercept the changes to this properties window?

I'm trying to intercept the change events triggered (any field) when this property window is changed in a VS Extension project (vsix). This extension will target VS versions upto 2019 (the latest one).
I've used dte.Events.TextEditorEvents.LineChanged but it captures the event intermittently.
Is there a specific event that I can look at for this purpose?
Initially I mistakenly thought IVsRunningDocTableEvents.OnAfterAttributeChange could be used. But after reviewing the designer code base (one of the few I've seen written in VB.NET), I found that this particular designer sets the windowframe's dirty by explicitly invoking IVsWindowFrame.SetProperty with VSFPROPID_OverrideDirtyState, which per the comments in the vsshell80.idl file:
VSFPROPID_OverrideDirtyState = -4014, // BOOL/EMPTY -- tri-state value to control dirty star (*) in window caption
// VT_EMPTY: default handling of dirty star
// VARIANT_TRUE: override default handling to SHOW dirty star
// VARIANT_FALSE: override default handling to show NO dirty star
indicates this designer doesn't leverage the default mechanism driven by the RDT. :-(
The only notification I could find that you could possibly intercept would be an IPropertyNotifyChange on the individual properties themselves, which does fire, as soon as you change a given setting and move focus to another control.
This may not be what you're looking for, but if you can explain why you need such a notification, I may be able to come up with something better than periodically polling the designers VSFPROPID_OverrideDirtyState property (which is the only other thing that immediately comes to mind).
Thanks,
Ed....

Windows Phone 7 Toolkit: How to reload the data in the Loopingselector control?

I'm using the LoopingSelector to show a series of timestamps. As time progresses, I'd like to update the timestamps in the looping selector.
I have a class that implements the ILoopingSelectorDataSource interface, but I can't figure out how to force the data to reload while the control is showing.
Claus is partially correct, there doesn't seem to be a way to use binding to update the control, but in code behind, calling
LoopingSelector.DataSource = new MyLoopingSelectorDataSource()
// your implementation of the ILoopingSelectorDataSource interface
will cause the control to reload data.
Basically you can't. The control doesn't update the currently rendered controls. You would have to rewrite the control to fit your purpose.
While you can easily make it calculate the time relatively to a given point upon the call to GetNext() or GetPrevious(), updating the elements already on the screen would require a invoke of a kind, or a constant update per second/minute or whatever fast you want them to update.

VtChart changes not saving in MS VB6

I'm working on some legacy code. I have a user control with a VtChart (VCI First Impression Library) in it and I'm trying to make changes to it, namely, adding another series to the control. However, every time I make changes to the control, close the form editor, then reopen it, the changes are gone.
I can't find any documentation on this control, so thought I'd ask the community, any ideas?
Ah! Found my answer. Since VtChart is connected to a grid (F1Book), the SsLinkRange needs to correspond to the number of columns needed in the chart. For example, if you want 3 columns, SsLinkRange should be A1:C10, where A and C is the column range. If the SsLink properties don't match it won't save the settings.
This is an very obscure problem, but I'll post this answer anyways for archiving.

How to speed up dynamically adding user controls in wp7

I have a page in my WP7 app that I build dynamically. I create and add 60 user controls to a grid and it takes around 5 seconds. I need to find a way of speeding this up.
The process is as follows:
Create user control
Add new grid row definition
Set the value of the control row property
Add the control to the grid.Children collection.
It is step 4 that is taking the time. I'm guessing that each time I do this the visual tree is getting re-built.
Is there any way of telling the grid to only re-build the visual tree after I have finished updating the children collection?
Or is there another better way of doing this?
UPDATE: The List Picker control from the WP7 Toolkit was causing the problem. When I changed to one I wrote myself the time taken to display the page on a phone reduced from 25 seconds to 1 second.
The/your aim is to try and reduce the number of times you update the visualtree.
A few suggestions:
Try including (some of) the items in the page by default but just change their visibility depending on what you need.
Build the whole grid in code and add it to the page in one go (rather than a line at a time)
Depending on your content, you could try using a ListBox and alternating the template used for each row to get different content displayed.
The technique which will be best for you will depend on what you're actually adding to the UI. You'll need to test to see what is best for you.
If the UI virtualization (i.e. ListBox) helped, the problem must be in your controls. Templating, bindings, converters, using Xaml instead of C# code, unnecessary Xaml constructs (such as element names), overcomplicated visual tree (e.g. unneeded grids) etc. - those are the things that can degrade the performance.
If you suspect incremental visual tree rebuilds (I don't think so), then simply debug MeasureOverride/ArrangeOverride methods.
I guess this article might give you more tips. I described there how we optimized a similarly complex control - MonthCalendar with 126 sub-controls. Control load time decreased approx. 5x!

How can I check the time format entered in a textbox?

I'm using VB 6, and my form has a TextBox control. I want the user to be able to enter the time in the textbox, but I have to validate whether the input time is correct or not.
Example:
Textbox1.Text = 236161 '(User Input)
236161 = HHMMSS
The above entered time is wrong because the minutes and seconds are greater than 60.
What code can I use to check the format of the time entered in the textbox?
I suggest that you use a DTPicker control, instead. This is the date/time picker that is available for VB 6 applications, and it essentially forces the user (but much more gently than that makes it sound) to enter a valid time in the proper format. Trying to do this validation yourself is a giant pain in the rear, and not worth the effort since using a built-in control makes it so much simpler.
You can start using this in your project by following these steps:
In the VB 6 IDE, open the "Project" menu, and then click "Components" (or press Ctrl+T).
Scroll down nearly to the bottom of the list and select "Microsoft Windows Common Controls-2" (preferably version 6.0, if available, rather than version 5.0).
Once you click OK, you will find a handful of new controls added to your toolbox. Find and click on the one called DTPicker. It will look something like this:
Drag the DTPicker control to your form.
Make sure that the control you just added is selected, then in the "Properties" window, scroll down to the "Format" property and set it to "2 - dtpTime". This specifies that you want to accept a time value in the DTPicker control, rather than a date.
With .Net you have regex included. With VB 6 you have to use COM or ActiveX libraries and add them as references to your project (http://www.regexlib.com/DisplayPatterns.aspx?cattabindex=4&categoryId=5 or http://support.microsoft.com/kb/818802)
For samples of regex to check time see: http://www.regexlib.com/DisplayPatterns.aspx?cattabindex=4&categoryId=5
Actually, you can use the format function like this:
TestStr = Format(TestDateTime, "HH:mm:ss")

Resources