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

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

DoorEx library

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-25-2009, 04: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 DoorEx library

This library extends the functionality of the Door library. This first version implements a "FromString" method that will obtain the reference to either a Basic4ppc control or external library object when provided with the name of that control or object as a string.

The reason for providing this is that you can't indirectly address a library object using the Control keyword in an optimised compiled app because the optimised compiler needs the Control(name, type) form of the Control keyword and "type" cannot be a variable and so is limited to the one type of control specified at compile time. Using "FromString" you can get the reference and then get or set properties or run methods using the Door library.

EDIT : Version 1.1 posted. See post #6 for details

EDIT : Version 1.2 posted. With Erel's permission this library now includes all the original Door library functions so can it be used as a replacement for instead of alongside the Door library which makes some things a little easier. See post #11 for details.
Attached Files
File Type: zip DoorEx1.2.zip (26.6 KB, 242 views)

Last edited by agraham : 09-23-2009 at 02:08 PM.
Reply With Quote
  #2 (permalink)  
Old 03-26-2009, 09:29 AM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Agraham it is great!big thanks!you are my Hero))
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #3 (permalink)  
Old 03-26-2009, 10:25 AM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Sorry that I ask here...
Code:
obj.SetProperty("ForeColor",rgb(255,0,0))
return error
Quote:
Object of type 'System.string' cannot be converted to type 'System.Drawing.Color'
how can i convert string to color? :-[
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #4 (permalink)  
Old 03-26-2009, 10:32 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 Byak@ View Post
how can i convert string to color? :-[
There's an example in Door help->Overview->Passing color value
Reply With Quote
  #5 (permalink)  
Old 03-26-2009, 02:46 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

big thanks)
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #6 (permalink)  
Old 03-27-2009, 05:27 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

If you thought the Door library was a bit arcane

I've been playing over the last couple of days passing things around between libraries and Basic4ppc code and have provided a few more things that made it easier to do some things with the Door library. The most useful for mere mortals is probably ValueToColor, "obj.ValueToColor = cRed" or "obj.ValueToColor = RGB(255,0,0)", which saves a lot of typing. See the help for details.

I won't attempt to provide a demo file for this. If the help is not enough then you probably need to learn more about .NET.

I am happy with GetProperty for collections indexed by keys but I have not thoroughly tested the SetProperty variants, but as the famous last words said "it should work" (but probably won't)

Erel once amusingly wrote to me in an email "However it wasn't checked and therefore it doesn't work ". I should frame that one really and put it on the wall As Richard Feynman wrote about the fine structure constant "it's something every physicist should write on their blackboard and worry about!"
Reply With Quote
  #7 (permalink)  
Old 03-28-2009, 05:58 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Quote:
Erel once amusingly wrote to me in an email "However it wasn't checked and therefore it doesn't work ". I should frame that one really and put it on the wall As Richard Feynman wrote about the fine structure constant "it's something every physicist should write on their blackboard and worry about!"
LOL
Reply With Quote
  #8 (permalink)  
Old 04-01-2009, 06:55 PM
Junior Member
 
Join Date: Sep 2008
Posts: 29
Default

[quote= If the help is not enough then you probably need to learn more about .NET. [/QUOTE]

I can't find the solution in any .NET searchs.


mycolor = "255,0,0"


Button1.Color = mycolor (Doesn't work)
Button1.Color = RGB(mycolor) (This too)

In my app, MYCOLOR isn't really a variable, but the foreground and background colors (in RGB) are in a Class Flag Color database table. The button color needs to change (and rechange) depending on the Class selected.

Could I have just a tiny, one line example of how to change color when the desired color is a TEXT item in a database?

Regards

Ed Sharp
Reply With Quote
  #9 (permalink)  
Old 04-01-2009, 07:20 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You don't need to use any library for this.
Code:
Sub Globals
 
Dim Type (R,G,B) clr
End Sub

Sub ...
 somestring = 
"255,0,0"
 clr() = StrSplit(somestring,
",")
 Button1.Color = RGB(clr.R, clr.G, clr.B)
Reply With Quote
  #10 (permalink)  
Old 04-02-2009, 11:33 AM
Junior Member
 
Join Date: Sep 2008
Posts: 29
Default

Erel,

Once again, thank you for your help. It's all so simple when you just know how.

Ed Sharp
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
Merging Outlook library and Phone library Erel Official Updates 11 09-15-2010 09:22 AM
PhoneticAlgorithms Library (ex-StringComparison Library) moster67 Additional Libraries 10 11-11-2008 07:46 PM


All times are GMT. The time now is 06:48 AM.


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