Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Buttondown and pendown

Buttondown and pendown

Discuss PocketC for CE (including Desktop Edition)

Postby chris.ledsam on Tue May 21, 2002 2:09 pm

I am trying to create a PocketScrabble game with all the usual features.
However I am bogged down by my inability to access the 'board', the 'Rack' and the 'Buttons'( moving the player through the game sections), separately.
I use the closed loop for the main gameplay
with 'ButtonDown' and 'pendown' with each selection tagged( to indicate what part of the game we are at).
The nub of the problem is that using @the pendown and buttondown features cause the penX and penY positions to move in the Button area and create a visible replica position and image on the 'Board'.

Is it possible to separate these events,so that they operate independently and not at the same time.
Ie Pressing the 'button' does not create an 'event on the 'board'?

Any thoughts and help gratefully received

Chris.ledsam
chris.ledsam
 
Posts: 8
Joined: Tue Jun 26, 2001 8:43 pm
Location: United Kingdom

Postby guy on Wed May 22, 2002 9:50 am

I don't quite understand what you are getting at. The pen down and button down events are the same event. The actual event is named button down because it originates as a mouse event on big windows. Pendown is just a synonym.

If you are looking for events on a command button then you need to look for PM_COMMAND event on the button (strictly you should then call getnotify() and check that the notification code is BM_CLICKED).

You will also get pen down, pen up and possibly pen move events for the button whilst the user is clicking it.

You also need to be aware that the penx() and peny() functions return signed values relative to the top left corner of the control on which you put the pen down. The signed value is truncated into 16 bits, which means that negative offsets look like large positive values. To convert use:

if (coord & 0x8000) {
coord = coord | 0xffff0000 ;
}

For both x and y.

If you post some more information then I'll try to be a bit more helpful.


Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library



Edited by - guy on 05/22/2002 04:51:52
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby ianf on Thu May 23, 2002 10:46 am

Hi
You are using the simplest form of dealing with events & should take Guy's advice & get more into the fuller features.

As a game's developer I can help but would need more info.

Ian
ianf
 
Posts: 92
Joined: Mon Dec 11, 2000 7:25 am
Location: United Kingdom

Postby chris.ledsam on Thu May 23, 2002 11:32 am

These 'getnotify()' messages - where can I get the information I need to find abouth BM_CLICKED and others.

BTW the 'board' resides as a graphic on the main window and the 'buttons' are 'children' of the 'main' window.

Is this the wrong way round?
Chris ledsam
chris.ledsam
 
Posts: 8
Joined: Tue Jun 26, 2001 8:43 pm
Location: United Kingdom

Postby guy on Thu May 23, 2002 12:19 pm

My typing error, should be BN_CLICKED.

When you get a PM_COMMAND event, you have to call the getnotify() function to get the type of event. For buttons you can probably assume that the button was clicked and not worry about calling getnotify(), particularly since Kevin does some internal messing around with other button commands. Other control types return PM_COMMAND for a variety of different actions (multi select list boxes send you PM_COMMAND for just about anything the user does to the box).

The notify codes for PM_COMMAND events can be found in windefs.h, which you can get from the CE API kit, the desktop compiler kit, the PCForm kit, or just hanging around somewhere. There are various versions and copies around. The most up to date is in the CE API developer kit.

Having the board as a graphic and the buttons as children is the correct way to do it.

From the point of view of the board, you will get PM_BUTTONDOWN and PM_BUTTONUP messages for guiid=1 when the user clicks the board, and a PM_COMMAND message for a guiid>2 when the user clicks one of the buttons. The penx() and peny() functions will give you the offset of the pen on the screen for the board (guiid=1) and an offset from the corner of the button for the button clicks (guiid > 2).

It looks like your problem relates to not checking the guiid that generated your event.
This will allow you to simply work out to which object the event applies.


Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby chris.ledsam on Thu May 23, 2002 2:25 pm

I think the light has dawnd with the last couple of paragraphs, Guy.

Many thanks. - I will try this now I have a bit more time.

Thanks to everyones help igiven in various guises. ie Text file handling, and some others.

Is there anyone out there who has a word list for Spanish, german, french etc so I will be able to make to game, language choice dependent?

Chris Ledsam
chris.ledsam
 
Posts: 8
Joined: Tue Jun 26, 2001 8:43 pm
Location: United Kingdom

Postby guy on Thu May 23, 2002 2:31 pm

I don't have a word list, but I do have both the French and English versions of Scrabble. The French version has a completely different letter distribution to the English version. If you try to use english words with the French set you end up with far too many letter "E"s.

I think some of the letter scores are different as well.

You could try searching the net for word lists. There must be complete free dictionaries out there somewhere.



Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby chris.ledsam on Thu Jun 20, 2002 4:31 am

Thank you to all who 2stuck their oar in" and donated their valuable help to me, in the matter of button pressing.

I have now got them to distinguish between the playing area and the buttons.

Thanks again guys
Chris
chris.ledsam
 
Posts: 8
Joined: Tue Jun 26, 2001 8:43 pm
Location: United Kingdom


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 3 guests

cron