Basic4ppc - Windows Mobile Development  

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

Code Samples & Tips Share your recent discoveries and ideas with other users.


Input Panel


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 07-02-2007, 02:13 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
CableGuy originally wrote:
But this would require a DLL wouldn't it?
If you compare it with a MsgBox then I don't think it would as program execution appears to halt until OK or one of the other MsgBox buttons is pressed.
The only way around this is by using Do Events before calling the MsgBox which would allow other event driven subs to sub simultaneously run, I think

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #12 (permalink)  
Old 07-02-2007, 02:26 PM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Yes, Cableguy, another DLL or implemented as a general keyword, such like the message box. I am sure Erel can handle that.
Reply With Quote
  #13 (permalink)  
Old 07-02-2007, 02:32 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Since I have a copy of VS5Pro installed I went to take a peek and there is a inputpanel control, so a dll is possible...and I'm guessing that one of the inputpanel methods do a halt to events until input..
Still I don't see How B4ppc is multi-thread, the code allway seems to be like in a flowchart execution way....So eve a simple input panel ( even a coded one ) halts execution until the user decides what to do with the inputed info...
__________________
Paulo Gomes
Porto, Portugal

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

DLL Version Listing

Last edited by Cableguy : 07-02-2007 at 02:34 PM.
Reply With Quote
  #14 (permalink)  
Old 07-02-2007, 03:50 PM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Greece
Posts: 353
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Isn't so difficult to make an input panel to have similar behaviour like a real inputbox. Disable controls of the form and put caller code in a loop (with doevents) waiting for a variable to be true when the user will press a button of the input panel.

I think this will do the trick.
__________________
Dimitris Zacharakis
http://www.terracom.gr
Reply With Quote
  #15 (permalink)  
Old 07-02-2007, 04:34 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default

This is exactly as I was meaning. I think it will work.

Regards,
RandomCoder.
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #16 (permalink)  
Old 07-03-2007, 04:51 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Gentlemen,
DoEvents in a Loop Until does work indeed. It would just be more elegant to have the system open a nice input box without additional controls and workaround source code. This is issue probably better placed in the Wishlist category
Reply With Quote
  #17 (permalink)  
Old 07-03-2007, 12:10 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Do you mean something like IgnoreEvents True or False??
That would appear to be a simple solution but then there might be undesirable side effects like being unable to catch the KeyPress Event to catch user mistakes etc.

Regards,
RandomCoder.
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #18 (permalink)  
Old 07-04-2007, 04:29 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi RandomCoder
It's a bit cluttered but this works for me for a while:


Sub App_Start
reg.New1
honyaku="your_registration_code"
Registration
:::::::::
End Sub

Sub Registration
frmRegistration.Show 'A form with a text box and an OK button
Do
DoEvents
Loop Until mnuRegister.Enabled=False
If txtRegister.Text=honyaku Then
Return 'continue with code in App_Start
Else
AppClose 'or prohibit any further use after tap on (ok) if the registration key is wrong
End If
Else
MsgBox("Unregistered Version!"," Shareware Info", cMsgBoxNone, cMsgBoxAsterisk)
End if
End If
End Sub

Sub buttRegister_Click 'the OK button
if txtRegister.Text=honyaku Then
reg.RootKey(reg.rtCurrentUser)
key = "Software\RBSoft\Mokusei"
reg.SetStringValue(Key,"Owner",honyaku)
MsgBox("The software is now registered. Thank you!"," Shareware Info", cMsgBoxNone, cMsgBoxAsterisk)
mnuRegister.Enabled=False
Else
MsgBox("Wrong registration key!"," Shareware Info", cMsgBoxNone, cMsgBoxHand) 'mnuRegister still enabled
End if
End Sub

Sub mnuRegister_Click
frmRegistration.Show
End if


Please be aware that the registration key in honyaku="your_registration_code" in the compiled exe is visible in a HEX viewer, hence not safe enough a solution.
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
a panel question Ricky D Questions & Help Needed 2 10-23-2008 09:08 AM
Panel Georg Questions & Help Needed 1 08-06-2008 10:01 AM
Scrollbar on a Panel willisgt Questions & Help Needed 5 03-10-2008 09:12 PM
autoscrollable panel Henry Questions & Help Needed 7 11-12-2007 07:40 PM
How to draw into a Panel? BasicUser Questions & Help Needed 1 07-21-2007 07:28 AM


All times are GMT. The time now is 03:53 AM.


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