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.


HOTSPOT controls


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 04-19-2008, 10:04 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,183
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by WZSun View Post
That is a great one... for rectangle hotspot.
Rectangle is the easiest. Attached demo tests also for circular and triangular hotspots. You can code more complicated shapes if needed but I am not sure how valuable that would be for a real application.

Quote:
Does it work for scrollable panels?
I'd be interested to know how you intended to get a scrollable panel as I didn't think you could do it in B4PPC. That is until now, see this new demo.

@Erel - Could we do with a repository (thread?) somewhere for these easy but useful tricks with the Door library, like this scrollable panel and the HScrollBar on a TextBox?. People who do not have the knowledge of the underlying .NET control properties could browse there for ideas.
Attached Files
File Type: zip HotSpots2.zip (12.3 KB, 18 views)
Reply With Quote
  #12 (permalink)  
Old 04-19-2008, 12:52 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,183
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Finally an example of hit-testing an arbitrary shape using a Bitmap from the ImageLib library that holds a small bitmap of the tested shape.
Attached Files
File Type: zip HotSpots3.zip (66.0 KB, 36 views)
Reply With Quote
  #13 (permalink)  
Old 04-19-2008, 01:59 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,572
Default

Quote:
Originally Posted by agraham View Post
@Erel - Could we do with a repository (thread?) somewhere for these easy but useful tricks with the Door library, like this scrollable panel and the HScrollBar on a TextBox?. People who do not have the knowledge of the underlying .NET control properties could browse there for ideas.
The best place for these useful tricks is the Code Samples & Tips sub forum.
It doesn't matter too much if the code is using or not using the Door library as long as it is helpful for other users.
Reply With Quote
  #14 (permalink)  
Old 04-20-2008, 05:05 AM
Junior Member
 
Join Date: May 2007
Posts: 36
Default

Quote:
Originally Posted by agraham View Post
Rectangle is the easiest. Attached demo tests also for circular and triangular hotspots. You can code more complicated shapes if needed but I am not sure how valuable that would be for a real application.
Thanks.. will check on it.

Quote:
I'd be interested to know how you intended to get a scrollable panel as I didn't think you could do it in B4PPC. That is until now, see this new demo.
Why not? I used Scrollbar.dll to attach a panel and make it scrollable.

sb.New1("Form1",0,251,240,18,false)
sb.Maximum = 180
sb.SmallChange = 20
sb.LargeChange = 20
.
.
Sub sb_ValueChanged
Panel10.Left = -sb.Value
End Sub

Quote:
@Erel - Could we do with a repository (thread?) somewhere for these easy but useful tricks with the Door library, like this scrollable panel and the HScrollBar on a TextBox?. People who do not have the knowledge of the underlying .NET control properties could browse there for ideas.
Yes, I agreed tricks and tips should be stored in a common location so that we can search for it asap, instead of 'finding the needle in a haysack' by browsing through all mails in this forum.
Reply With Quote
  #15 (permalink)  
Old 04-20-2008, 08:17 AM
Junior Member
 
Join Date: May 2007
Posts: 36
Default

Agraham's sample demos are great.. but from a beginner's pointof view - it's too complex... if there are multiple objects on multiple forms.. Perhaps it's due to my limited skillsets..

I searched and found this - http://www.codeproject.com/KB/buttons/hotspot.aspx

maybe someone can expand on this to make it Basic4PPC compatible...
Reply With Quote
  #16 (permalink)  
Old 04-20-2008, 08:45 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,183
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by WZSun View Post
Why not? I used Scrollbar.dll to attach a panel and make it scrollable.
That's not quite the same thing. That moves the panel itself which I assume has to be wider and/or higher than the Form, rather than scrolling a large object within the panel.

Quote:
I searched and found this - http://www.codeproject.com/KB/buttons/hotspot.aspx
You think my demos are too complex compared to this?

Last edited by agraham : 04-20-2008 at 08:52 AM.
Reply With Quote
  #17 (permalink)  
Old 04-20-2008, 12:51 PM
Junior Member
 
Join Date: May 2007
Posts: 36
Default

Hi agraham,
You're the expert.. so for me.. I just need a simple control.. will definitely check on yours in more details.. as currently I don't need the hotspots in my current project, although I may need to use them for my next forthcoming project.

I agreed your demos may provide a good workaround.. but not sure I want to go into that direction as coordinates checking are critical. On a serious note, your demos would come handy for more precise checking.. and I like the irregular hotspot you did in demos 2 and 3.. it may come handy for some future games projects...

Right now... for me, a simple 'transparent button' control (acting like a hotspot) is adequate as I can place them visibly on the form... and not worrying about coordinates.

Thought perhaps if Erel can add a 'transparent' option in the Properties of the current Image or Button controls, that will become a hotspot control instantly...
Reply With Quote
  #18 (permalink)  
Old 04-21-2008, 01:35 PM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 422
Default

Hi Andrew,

Thanks to your hotspot sample I got a much clearer view of the Door library.
The AutoScroll property for the panel simplifies code tremendously. So inspired
I also checked your ControlInfo source with which help I found that properties
for the desktop are not necessarily available for the device, such as AutoSize
for the PictureBox (Image control). Sad, but fact.

Your ControlInfo is a great reference, indeed! It saves hours of figuring out
why Door reliant code may not work on devices.

I have slightly redesigned the GUI basically replacing the TextBox with a
ComboBox for Control selection and also rem'd the Message boxes to favour
a Label displaying the parameters. No disrespect intended

You are doing really great in this forum!

Cheers
Robert
Attached Files
File Type: zip ControlInfoAlfcen.zip (6.7 KB, 28 views)
Reply With Quote
  #19 (permalink)  
Old 04-27-2008, 09:05 AM
klaus's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: Switzerland
Posts: 406
Awards Showcase
Competition Winner 
Total Awards: 1
Default

Hi Andrew and Robert

Thanks Andrew for the different examples of the use of the Door library which makes it more and more understandable to me.

I am also looking in the ControlInfo source to get information, but were missing a few controls.

I added the controls from the ControlEx library and ListView to list.

Sometimes it is still interesting to have the whole MSDN info.
So I added a direct link to the MSDN web site.

For me also, of course, no disrespect intended.

Update with more controls 2008.05.01

Best regards
Attached Files
File Type: zip ControlInfoKlaus.zip (7.7 KB, 24 views)
__________________
Klaus
Switzerland

Last edited by klaus : 05-01-2008 at 10:15 AM.
Reply With Quote
  #20 (permalink)  
Old 04-27-2008, 12:53 PM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 422
Default

Hi Klaus,
I was hoping that someone would add further controls
You did great on developing this project further.
Tausend Dank and cheers
Robert
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
COM controls lairdre Questions & Help Needed 3 02-28-2008 08:53 AM
Disposing Controls RandomCoder Questions & Help Needed 7 02-19-2008 09:26 AM
Getting names of controls BjornF Questions & Help Needed 2 01-09-2008 02:05 PM
Controls name PepSoft Questions & Help Needed 4 12-17-2007 02:49 PM
Tab Order for Controls BPak Questions & Help Needed 2 05-06-2007 05:58 AM


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


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