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

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

Bug Reports Post about errors or bugs encountered.

ControlType() and library objects

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-21-2007, 12:13 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 ControlType() and library objects

I don't know if this is a wishlist item or a bug so I plumped for a bug!

ControlType("object") returns "Other.SwrapObject" for any objects from a library. It would be nice if it returned the Class name from the library - which B4PPC already knows.
Reply With Quote
  #2 (permalink)  
Old 11-22-2007, 07:26 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,701
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You could use object.ToString to get the class name.
Reply With Quote
  #3 (permalink)  
Old 11-22-2007, 08:46 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

The problem is that this only works on objects from external libraries. If I iterate the controls returned by GetControls(""), which are a mixture of B4PPC native control and library objects it fails on the native controls. Please consider this for the next release. It is impressive that the treatment of external objects is so orthogonal with that of native controls (AddEvent, Control(), AddObject) but this is the one thing that I have found (so far ) that I can't work round.
Reply With Quote
  #4 (permalink)  
Old 11-22-2007, 08:57 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,701
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Here is a workaround:
Code:
c = "someobject"
If ControlType(c) = "Other.SWrapObject" Then
       
Msgbox(Control(c).ToString)
Else
      
Msgbox(ControlType(c))
End If
The object must first be created (using New).
This will be fixed in the next version.
Reply With Quote
  #5 (permalink)  
Old 11-22-2007, 11:00 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:
This will be fixed in the next version.
Thank you Erel.

I have already tried that workaround but it is not precise enough identification. I wanted to know the actual type of a control but I can work around it for time being.


You obviously realised what I was after but of course my previous post
Quote:
it fails on the native controls
Should have been "fails on the library controls"
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
ControlType for ArrayList glook Bug Reports 2 02-18-2008 10:31 AM
Table objects? LineCutter Questions (Windows Mobile) 2 02-08-2008 07:41 AM
Cannot (always) use Objects as parameters Woinowski Bug Reports 12 01-07-2008 10:36 AM
Help about variables/objects skipper Questions (Windows Mobile) 6 12-19-2007 03:45 PM
Classes and objects emidio78 Basic4ppc Wishlist 2 09-28-2007 12:21 PM


All times are GMT. The time now is 03:01 PM.


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