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.

Results To Other Module

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-27-2009, 03:04 PM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 312
Default Results To Other Module

Hi

I need help.

My surveying program consists of a couple of modules. When I am in one of the modules (say COGO calcs) and a textbox has the focus where I need to enter some data in. But before I can do that, I first need to calculate the info which needs to be entered in the Textbox, which I do with the "Calculator" which sits in another module.

Now my question. Can I send the results straight from the "Calculator" module to the other module in the textbox which had the focus?

I am attaching my "Calculator" module. There I have a button which has ">>" on it. The idea is that once I have done my calculations and I press the ">>" button, then the "Calculator" module should unload and the results be displayed in the textbox which had the focus before I loaded the "Calculator" module.

Thanks
Michael
Reply With Quote
  #2 (permalink)  
Old 05-27-2009, 04:52 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

I think that you may have the wrong idea about what modules are. They don't "load" and "unload" thay are merely a way of partitioning your source code into functional parts and are all compiled together into the final exe. Using modules doesn't alter the structure of the code from if you had everything in the main module. It just lets you hide private clutter and just make public the Subs and Globals you want to use in other parts of your program by prefixing them with the module name.

Having called your calculator code from your code you need to save the result in some Globals or a file or stick them in a textbox or a table or whatever you want so you can access them later from some code that knows what to do with it. Just like you would have done without modules.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #3 (permalink)  
Old 05-27-2009, 06:11 PM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 312
Default

Hi Agraham

Thanks for your reply.

I know what modules are all about and how they work. It is just that I got my sentences mixed up. It is sometimes difficult to think in german and write in another language!

I am not really sure that you understand what I want to do. I am busy with a "Polar" calculation, but for the angle input textbox, I need to add 2 angles. Now,.....the angle input textbox has the focus and I click on the "Calculator" icon to add the 2 angles. Then I click on ">>" on my calculator; the calculator closes (hides....or whatever you want to call it! and hey presto the answer sits in the input textbox that had the focus. This way I don't have to write the answer on my hand in the field. If I carry on like this I will get blood poisening!

While I have your attention. May I send through my (yours ) delauney module. I need to me able to delete triangles and also add "Manually" triangles by tapping on points on the screen. You will also see that I have a "Shading" routine. But it does not work very good. Maybe you can give me some ideas.

And lastly. I am nearly finished with my CAD module. Works very much like Autocad Lite. If I send it through could you have a look to put it in a DLL?

Thanks
Michael (alias Ceaser)
Reply With Quote
  #4 (permalink)  
Old 05-27-2009, 08:12 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

Hi Michael,

As a workaround for your calculator you could:
- add a same ContextMenu to your TextBoxes that calls the calculator
- in the contextmenu you can get, with the Door library, the calling TextBox name and transfer it to the calculator
- in the calculator, in the SendResults_Click routine, you can set the result in the right TextBox.

Attached a sample program with a main module with a window with 3 TextBoxes, the ContextMenu and your Calc module a little bit modified.
I changed the form name from Calc to frmCalc, because having the same name for the module and for the form provided some trouble for calling the calculator.
I also changed the module name to avoid any mix up with yours. To replace your module with mine, in your program, just change it's name back to 'Calc'.

Hope this would help you.

Best regards.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
  #5 (permalink)  
Old 05-27-2009, 10:54 PM
Basic4ppc Veteran
 
Join Date: May 2008
Location: Newcastle Upon Tyne - England
Posts: 271
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I wonder if you may get any ideas from this? Here is my test code for calling up a keypad in the device. Instead of using focus events of a textbox, I've made buttons that look like text boxes. When finished entering the desired value, the calling button's .text value is set. You may then evaluate this elswhere in your code.

I appreciate you will have to add your calculator code to the keypad sub - it is just an idea for you.
Attached Files
File Type: sbp Keypad.sbp (3.7 KB, 12 views)
Reply With Quote
  #6 (permalink)  
Old 05-28-2009, 07:55 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 ceaser View Post
May I send through my (yours ) delauney module. I need to me able to delete triangles and also add "Manually" triangles by tapping on points on the screen.
I'm not sure what you mean by "send through" but yes.

Quote:
If I send it through could you have a look to put it in a DLL?
No promises but I'll take a look, though the only reason to dll it would be for maths performance - is that why you want a dll?
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #7 (permalink)  
Old 05-29-2009, 01:51 PM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 312
Default

Hi Agraham

What I mean by "send through" is to post the module on the forum. Sorry for my English!!

You are right, the only reason for the DLL is for maths involved in the CAD module.

Coming back to your Delauney routine. I have a routine called "Shading", which shades the triangles according to the average heights of the three vertices of each triangle. Now if you only one triangle then one sits with only one color. Is there not a faster way of shading the triangles according to the gradient of each side of the triangles? So if one has only one triangle the one side would start off with say a blue color and as it progresses up to the higher vertice point, it slowing changes to a more lighter color.

I hope you can help me.

Regards
Michael

PS. I hope my English is OK
Reply With Quote
  #8 (permalink)  
Old 05-29-2009, 04:10 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 ceaser View Post
Is there not a faster way of shading the triangles according to the gradient of each side of the triangles?
Faster than what? How are you shading the triangles at the moment? What you seem to want is a gradient fill of a triangle. At the moment I know of no way of doing this in .NET.Basic4ppc. It might be possible by making a native call as ImageLibEx does to gradient fill a rectangle but I have never actually tried it.
Quote:
I hope you can help me.
If you post some code for me to play with and an explanation of what you want I will see.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
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
Properties module - useful module for working with properties / ini files Erel Code Samples & Tips 2 10-13-2011 09:02 PM
FolderChooser als Module Paulsche German Forum 2 04-03-2009 08:39 PM
Unclear Module Reference HARRY Questions (Windows Mobile) 2 01-08-2009 12:46 PM
Storage of module klaus Beta Versions 6 08-31-2008 02:36 PM
incorrect results on screen size 480x272 gs4322 Questions (Windows Mobile) 5 01-15-2008 04:40 PM


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


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