Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Problem with Door-Library on Device

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-03-2009, 08:36 AM
CryoGenID's Avatar
Knows the basics
 
Join Date: Feb 2009
Location: Munich, Germany
Posts: 62
Default Problem with Door-Library on Device

Hello everybody!

It's me again and I have (well what else *g*) a problem

I am currently trying to use the great door-library to raise some events when I click into a, for this example, textbox.

This is the code which works perfectly all right on the desktop:
Code:
Sub App_Start
...
objectHotSpotFillLevelClick.New1(
False)
objectHotSpotFillLevelClick.FromControl(
"textBoxFillLevel")
eventHotSpotFillLevelClick.New1(objectHotSpotFillLevelClick.value,
"MouseClick")
...
End Sub

Sub eventHotSpotFillLevelClick_NewEvent
    objectHotSpotFillLevelClick.value = eventHotSpotFillLevelClick.Data
    x = objectHotSpotFillLevelClick.GetProperty(
"X")
    y = objectHotSpotFillLevelClick.GetProperty(
"Y")
    
CallSub ("doHotSpotCheck""fillLevel", x, y)
End Sub
So that works perfectly on the desktop... I click into the textBox and
my Sub "doHotSpotCheck" gets called and displays an AlertBox.

BUT here comes the problem:
On the device I get directly when I start my app an error:
"An error occured on sub _main_app_start.
NullReferenceException
Continue?"

Ok then I thought the "MouseClick" might be the problem, so I changed it to:
Code:
objectHotSpotFillLevelClick.New1(False)
objectHotSpotFillLevelClick.FromControl(
"textBoxFillLevel")
eventHotSpotFillLevelClick.New1(objectHotSpotFillLevelClick.value,
"TextChanged")
Now the program starts and when I change the text in the textbox, I get
this (same) error:
"An error occured on sub _main_eventhotspotfilllevelclick_newevent.
NullReferenceException
Continue?"

The problem seems to be this command
"objectHotSpotFillLevelClick.GetProperty("X")" , as when I comment it out
I get no error (of course I also commented out the second line where this command occurs for the "Y"-value).

So I would really be very happy if anybody could help me:
- why do I get this error when I have "MouseClick" enabled?
- why do I still get an error when I jump into the event?

As I said before that all works perfectly well on the desktop!

Thanks a lot in advance for any help :-)

Best regards,

Chris
Reply With Quote
  #2 (permalink)  
Old 06-03-2009, 10:01 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by CryoGenID View Post
why do I get this error when I have "MouseClick" enabled?
The device does not support any mouse events on a Textbox. Look at the event list here TextBox Members (System.Windows.Forms). A little device icon denotes what is available in the Compact Framework.
Quote:
why do I still get an error when I jump into the event?
It's a different error. Event objects don't have X and Y properties, they only have a Data property that contains the EventArgs of the event. Look at the last example in the Door library help Overview topic. Different events have different EventArgs, you need to know what properties a particular EventArgs supports.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #3 (permalink)  
Old 06-03-2009, 02:45 PM
CryoGenID's Avatar
Knows the basics
 
Join Date: Feb 2009
Location: Munich, Germany
Posts: 62
Default

Thanks a lot for your reply!

I have just looked at the link you gave me, thanks for that as well!
But I am having trouble finding the "Image" Class there...

My final goal is to be able to catch the "click"-Event on an image (perfect if I would also get the XY-Coordinates where the Image was clicked)...
Or is there a workaround/trick to get that functionality to catch a click on an image?

Thanks a lot in advance!

Best regards,

Chris
Reply With Quote
  #4 (permalink)  
Old 06-03-2009, 02:57 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by CryoGenID View Post
But I am having trouble finding the "Image" Class there...
You want PictureBox PictureBox Members (System.Windows.Forms) which is what a Basic4ppc Image control is based on.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #5 (permalink)  
Old 06-03-2009, 03:06 PM
CryoGenID's Avatar
Knows the basics
 
Join Date: Feb 2009
Location: Munich, Germany
Posts: 62
Default

agraham,

perfect thanks a lot :-)
It is working now, just had to change "MouseClick" to "Click" ;-)

Just one last question: Where exactly can I get the list of the properties
which I could get with this command (for each class e.g. Image, textBox, etc.):
objectHotSpotFillLevelClick.GetProperty() ?

Thanks a lot again!

Best regards,

Chris
Reply With Quote
  #6 (permalink)  
Old 06-03-2009, 03:32 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by CryoGenID View Post
objectHotSpotFillLevelClick.GetProperty() ?
This is not a valid statement. Didn't you read the help I mentioned earlier? That is an example of accessing the mouse button from a MouseEventArgs returned by an event. To know what properties an EventArgs contains you need to look at the EventHandler for the event, which you can find by clicking on the event in the list of events. The type of EventHandler determines the type of the EventArgs so you need to find that in the documention.

If you want the X,Y coordinates the Click event doesn't return them as it returns a standard EventArgs. Use MouseDown which returns a MouseEventArgs that has X and Y properties that you can read. MouseEventArgs Class (System.Windows.Forms)
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #7 (permalink)  
Old 06-03-2009, 03:38 PM
CryoGenID's Avatar
Knows the basics
 
Join Date: Feb 2009
Location: Munich, Germany
Posts: 62
Default

Agraham,

thanks for your reply.
Yes sure I read the documentation. My question was basically where exactly I could get the information about which EventArgs/MouseEventArgs are available for which control and which Information is provided with which EventArg-Type...

Thanks a lot for your help, that has clarified a lot!

Best regards,

Chris
Reply With Quote
  #8 (permalink)  
Old 06-03-2009, 04:18 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,463
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

There does exist a small program to find more easily the Microsoft information about controls.
http://www.basic4ppc.com/forum/share...trol-info.html

It could be helpfull for you.

Best regards.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
  #9 (permalink)  
Old 06-03-2009, 04:48 PM
CryoGenID's Avatar
Knows the basics
 
Join Date: Feb 2009
Location: Munich, Germany
Posts: 62
Default

Klaus,

thanks a lot!
There is such a lot of great and valuable information/utils here, it is really hard to keep track of all that ;-)

Will that also work on the device and only show the events available for the device?

Thanks again,

best regards,

Chris
Reply With Quote
  #10 (permalink)  
Old 06-03-2009, 05:16 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,463
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

The program is more general, not only for the device.
I haven't tested it on the device, but it should work.
There is a direct link to Microsofts MSDN Internet site. There you have all detailed information and you will see if the property, event or method is available for the PPC's.

Best regards.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Door library (Beta) - Special library Erel Official Updates 60 01-13-2011 11:23 AM
Access to Enumerations with door.library? corwin42 Questions (Windows Mobile) 2 05-16-2009 09:51 PM
Door.dll on Device ignores doubleclick event RichardW Bug Reports 2 04-16-2009 11:58 AM
Door event in module - problem DaveW Questions (Windows Mobile) 4 11-12-2008 01:02 PM
Order a table with the library DOOR manu Beta Versions 0 09-04-2008 07:16 PM


All times are GMT. The time now is 04:28 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0