ControlsExDevice library

agraham

Expert
Licensed User
Longtime User
A very small counterpart to my ControlsExDesktop library. It provides a DateTimePicker control and an InputBox for getting user input. It will also work on the desktop if needed but ControlsExDesktop has both of the included controls now. Needs .NET 2.0 as DateTimePicker is not in .NET 1.0.

Help file and demo included.

EDIT :- updated to version 1.1 - see post below

EDIT :- Desktop dummy library added

EDIT :- Version 1.2 posted - see post below

EDIT :- Version 1.3 posted - see post below

EDIT :- Version 1.4 posted - see post #31

EDIT :- Version 1.5 posted - see post #37

EDIT :- If you haven't already seen it be aware of this pitfall http://www.b4x.com/forum/questions-help-needed/2834-cs0234.html

EDIT :- Version 1.6 posted. Controls are AutoScale aware and there is a discussion of AutoScale in the help - see post #54

EDIT :- Version 1.7 posted - see post #62

EDIT :- Version 1.8 with NotifyIcon posted - see post #65

EDIT :- Version 1.9 with some bug fixes posted - see post #80

EDIT :- Version 1.91 posted with the same bugs fixed properly this time :( - see post #81

EDIT :- Version 1.92 posted - see post #83

EDIT :- Version 1.92a posted - see post #86
 

Attachments

  • ControlsExDevice1.92a.zip
    118.9 KB · Views: 293
Last edited:

alfcen

Well-Known Member
Licensed User
Longtime User
Andrew, you made my days for quite a while :)
The date/time picker, notification bubble and the input box
are awesome enrichments to B4PPC which truly benefits from
increasing professional look and feel plus shorter code.
Thanks so much for the hard work!
No doubt, the entire forum is celebrating you.
Cheers
Robert
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hi Andrew,
Still having lots of fun with your library :)
Two very minor issues I came across:

1. The input object is not VGA-aware (cosmetic issue)
2. Can't get the time zone displayed
B4X:
dtpick.Format=8
    dtpick.CustomFormat="MMM dd, yyyy HH:mm:ss (tt) zzz"

And perhaps a wish if I may,

Is is possible to add Screen.Width and Screen.Height returning the
dimensions of the physical screen, irrespective of form dims and optimized
or legacy compiled applications? The idea is to query the device for VGA
or QVGA displays.

Cheers
Robert
 

agraham

Expert
Licensed User
Longtime User
Hi Robert

1. The input object is not VGA-aware (cosmetic issue)
I'm afraid that is .NET/OS issue I can do nothing about.

2. Can't get the time zone displayed
I copied the Custom Date Format part of the help from my ControlExDesktop help and that in turn I got from the .NET DateTime object custom formatting help. It looks like the DateTimePicker control, for some reason, only implements a sub-set of the formats available. The good news is that, although undocumented, the B4PPC DateFormat() & TimeFormat() functions support most of those formats including time zone (on the desktop at least, I haven't tried the device) because they both use a .NET DateTime object. Actually they are really the same function and both return identical results when given the same format strings. DateFormat() is not restricted to date formats and TimeFormat() is not restricted to time formats! Have a play :)

Is is possible to add Screen.Width and Screen.Height returning the
dimensions of the physical screen, irrespective of form dims and optimized
or legacy compiled applications? The idea is to query the device for VGA
or QVGA displays.
Yes, I was going to polish the library a bit so I will add this.
 

agraham

Expert
Licensed User
Longtime User
Version 1.2 posted in first post.

A Notification object on the desktop now shows a message box and fires events to emulate what happens on the device.

A StatusBar control is added, but is of limited functionality (device limitation) showing a single line of text.

A Display object is added that lets the height and width of the screen in pixels be determined.
 

alfcen

Well-Known Member
Licensed User
Longtime User
Shame on me. You are doing all this whilst I had a drink in a pub to your good health :)

I will have a play shortly with the update, and let you know. Sounds exciting,
the undocumented features hidden in the data and time formats as well.
Can't tell you often enough, you're a bloody legend, mate.

Hicks
Robert
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hello again, Andrew,

Display.width and height return the form dimensions, not the screen's.
Specifically, I am running a non-optimized compiled application (pixel doubled)
in a VGA device. Display.Width returns 240 while there are 480 physical
pixels. Hmm, I'm beginning to believe that this job can't be done by a library.
Probably, this information is stored in the registry in device vendor specific locations.

BTW, the help file topics Display and Status Bar have the same contents.

Sorry, indeed, for no better feedback. You spend so much time in devotion
for this forum. I am really happy with the library as it is.

Cheers
Robert
 

agraham

Expert
Licensed User
Longtime User
Display.width and height return the form dimensions, not the screen's.
To be pedantic they are the screen dimensions but it is the size of the virtual screen that is being drawn on rather than the physical size that is being returned. I haven't yet found a way to get that.

BTW, the help file topics Display and Status Bar have the same contents.
Thanks for pointing that out. I had written them correctly in the Help source but a quirk of the Help Compiler resulted in the same text being shown for two different topics - now corrected in the zip.
 

agraham

Expert
Licensed User
Longtime User
Probably, this information is stored in the registry in device vendor specific locations.
Have you poked around HKEY_LOCAL_MACHINE\Drivers\ Display\... The names of the entries may be manufacturer/software driver specific but you are looking for something like "CxScreen" and "CyScreen". They might be virtual or physical sizes - I don't know and don't have access to a vga device to find out.
 

alfcen

Well-Known Member
Licensed User
Longtime User
Thanks a lot Andrew, I found it a while ago. The registry key names vary
with the device vendor and/or LCD OEM supplier.
Curiously, the iPAQ h2210 shows 480 x 640 although the screen is physically
QVGA. Standards would be of help here :)
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hi Andrew,
Another undocumented feature. The text property notifier in your awesome
ControlsExDevice library accepts HTML tags by which you can format the notification message. The image tag <img src...> is supported but won't display any image.
The attached screen snap demonstrates the superb performance of your
most recent jewel.
 

Attachments

  • weather-bubble.jpg
    weather-bubble.jpg
    75.9 KB · Views: 102

agraham

Expert
Licensed User
Longtime User
The image tag <img src...> is supported but won't display any image.
From the .NET documentation
The text can be plain text or HTML. The Pocket PC HTML control renders the HTML to be the best of its ability. The following elements are unsupported and ignored:

BGSOUND tag
images
meta tags
script
I chickened out of mentioning the HTML bit in the Help in case it opened a bag of worms in support terms as my knowledge of HTML is c***p :) I also haven't implemented its ability to respond to links. Also from the MS docs -
In addition to plain text, you can create a user notification with HTML content in the message balloon. The HTML is rendered by the Pocket PC HTML control, and you can respond to values in an HTML form by parsing a response string provided by the ResponseSubmittedEventArgs class, through the Response property.

Cmd:2 Identifier
The identifier "cmd:2" has a special purpose in Windows CE and is used to dismiss notifications. If cmd:2 is the name of an HTML button or other element in a message balloon, the ResponseSubmitted event is not raised. The notification is dismissed, but its icon is placed on the title bar to be responded to at a later time.
If anyone understands what that means and thinks it is useful I can implement the event and provide the response string.
 

alfcen

Well-Known Member
Licensed User
Longtime User
Uggh, I should have sent you a private message regarding the HTML issue :sign0013:

Ability to respond to values in an HTML form would be fine, but is
not essential.

Can you please unveil the link which leads to the .NET documentation
you have quoted? Then, I will be quiet for while :)
 

agraham

Expert
Licensed User
Longtime User

agraham

Expert
Licensed User
Longtime User
Version 1.3 posted with updated help and demo app. This now documents the fact that HTML is rendered in the notification ballon and user input is accepted. A new ResponseSubmitted event fires on user selection and a Response property contains the HTML response string.
 

Cableguy

Expert
Licensed User
Longtime User
Hi Andrew,

I've been playing a bit with your dll, and found that it is not possible to add the calendar control to a Panel, and since there is no "change Parent" available, it renders the control useless in some applications...
 
Top