Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


working with FormExDesktop_1.2


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 01-27-2008, 06:15 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,316
Default

I know I do not need to add the dll twice to work with 2 inherited forms, but waht about the component? do i need to create a component for each form?
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #12 (permalink)  
Old 01-27-2008, 06:19 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,690
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Cableguy View Post
but waht about the component? do i need to create a component for each form?
Lets be pedantic about terminology . Add Component adds the dll, which as you say you do once. You need to add an FormEx object for every B4PPC form that you inherit from.
Reply With Quote
  #13 (permalink)  
Old 01-27-2008, 06:23 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,316
Default

Quote:
Originally Posted by agraham View Post
Lets be pedantic about terminology .
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #14 (permalink)  
Old 01-27-2008, 06:34 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,690
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Cableguy View Post
you mean that if i close one form, i cannot show it again, if it was an inherit form?
But if I create a form in runtime I ccan create it any time I need, right?
Lets again be a bit pedantic. There is no real difference between a FormEx produced by the two sorts of "New". One inherits controls from a normal form, the other doesn't - that is the only difference. Both can have controls added or removed at runtime, inheriting from a B4PPC form is just a convenience to avoid adding everything at run time.

Once you close a FormEx with inherited controls those controls are lost. The original donor form will now be blank so you cannot inherit anything from it again.

I will have to get back to you tomorrow about re-using FormEx objects to be sure to give you a good answer. I've forgotten that level of detail about the code. You can always try it to see if it works
Reply With Quote
  #15 (permalink)  
Old 01-27-2008, 06:42 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,316
Default

sorry agraham, another issue...
Controls must be donated from an inherited form, when using new2...
But when the created form (with new2) is closed, all controls are disposed as well,...
Anyway to go around this issue?
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #16 (permalink)  
Old 01-27-2008, 10:45 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,690
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Cableguy View Post
Controls must be donated from an inherited form, when using new2
Actually New1 to be pedantic again New2 creates a blank form. I don't understand "must be donated", why must? You can either opt to inherit controls from a Form with New1 or create a blank FormEx with New2, the choice is yours. In both cases you can add further controls at runtime.

Quote:
But when the created form (with new2) is closed, all controls are disposed as well,...Anyway to go around this issue?
I assume you mean New1! Unless I am misunderstanding I thought that I covered this in post #9 of this thread. Trap the Closing event, call CancelClose and Hide the Form. It can then be reshown if required.
Reply With Quote
  #17 (permalink)  
Old 01-28-2008, 01:38 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,316
Default

Quote:
I don't understand "must be donated", why must? You can either opt to inherit controls from a Form with New1 or create a blank FormEx with New2, the choice is yours. In both cases you can add further controls at runtime.
In the help file it say the controls MUST be borowed from a B4PPC form, so i thought we could not created/add to the New2 form...in runtime...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #18 (permalink)  
Old 01-28-2008, 04:20 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,690
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Cableguy View Post
In the help file it say the controls MUST be borowed from a B4PPC form
I can't find must in the help but it DOES say that in the example program. The region "Build FormEx2" shows an empty FormEx2 being created by a New2 and then having controls added at runtime. This is your must I think. OK I could have made this a bit clearer, sorry for any confusion. AddControl is used to add B4PPC native controls like Button and TextBox etc. to a FormEx. The only way to bring such controls into existence is to first have B4PPC create them on a normal Form and then add them to a FormEx with AddControl, this is the reason for saying they must be added from a donor form. This region demonstrates adding BOTH a pre-existing and a runtime created Button to FormEx2.

Controls from a library don't need to go through this route as they have the Form on which to be created specified in their New constructor.If you look at the example the region "Build FormEx1" shows FormEx1 inheriting controls from a Form1 by a New1 and then demonstrates how to use controls from a library, in this case a ProgressBar from ControlsEx.dll at runtime.
Reply With Quote
  #19 (permalink)  
Old 01-28-2008, 05:19 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,690
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by agraham View Post
I will have to get back to you tomorrow about re-using FormEx objects to be sure to give you a good answer.
The FormEx object created in B4PPC by the menu Tools->AddObject is a B4PPC container for an instance of a FormEx. That FormEx instance is created by either New1 or New2. When a FormEx is "Hidden" that instance of a FormEx still exists with its' controls intact and may be reshown with "Show".

When a FormEx is "Closed" the FormEx instance that the B4PPC FormEx contained is destroyed together with all its' controls. If you try to access it you will get a "Cannot access a disposed object" exception. However you can reuse the B4PPC FormEx container by using New1 or New2 to create another FormEx instance which you will need to populate with controls.
Reply With Quote
  #20 (permalink)  
Old 01-28-2008, 06:51 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,316
Default

Thank's Agraham, I'm completly clarified...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with VGA screens Erel Tutorials 23 Yesterday 11:09 PM
Compiled EXE is not working on HP iPAQ214 mozaharul Questions & Help Needed 25 10-14-2008 11:18 AM
Forelayer not working(?) Cableguy Questions & Help Needed 5 08-16-2008 12:52 PM
Why is my drawer.New2() not working? willisgt Questions & Help Needed 3 06-29-2008 11:27 AM
working with date gjoisa Questions & Help Needed 3 03-29-2008 10:40 AM


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


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0