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 - Some questions about PocketC...

Some questions about PocketC...

Discuss PocketC for CE (including Desktop Edition)

Postby Thorsten Godau on Tue Jul 30, 2002 3:23 pm

Hi all,

i use PocketC Desktop Edition with a iPaq 3850
(with PocketC runtime for 2002) and started now
a bigger project (one positive thing is, that
i will provide a complex calculations file
so PocketC will be able to calculate with
real and imaginary parts ;-)). Now the came a few
questions up:

- Why isnt it possible to create a menu point
beside "File"?
- Can i manipulate this name "File" eg. to "Datei"?
- What kind of bitmap it has to be to use "drawbitmap()"
I think i tried everything, but my bitmap will not
appear on the screen. Some ideas?
- Whats the ID of the original file menu separator?
The menu is: Exit, Separator, Console, About. I found,
that the IDs are between 40001 and 40003. I used a workaround
by deleting the separator by position. But with ID it will
be more comfortable ;-)

TIA.

Regards, Thorsten
Thorsten Godau
 
Posts: 13
Joined: Tue Jul 30, 2002 3:12 pm
Location: Germany

Postby guy on Wed Jul 31, 2002 7:38 am

You can create a menu item other than File, and you can change the name of the File menu.

There are two ways that you can do this.

1. Use the cmdbar library. You can download this from the CEAPI link in my sig below. This works on all versions of CE for all platforms with both PocketC V2 and PocketC V3. The menu it creates doesn't look exactly the same as a "real" menu.

2. Use an unsupported and undocumented feature of the PocketC V3 library (discovered by Mickle):

If you include the MF_BYPOSITION flag in the menuins() and menudel() functions, the functions affect the menu bar and not the dropdown menu underneath the file menu.

So, to delete the "File" menu:

menudel(0, MF_BYPOSITION, 0);

To put items on your own menu bar:

#define M_ID_FRUIT 300
#define M_ID_SHOES 301
#define M_ID_PLACES 302
#define M_ID_HELP 303

menuins(0, 0, MF_BYPOSITION|MF_ENABLED|MF_STRING, M_ID_FRUIT, "&Fruit");
menuins(0, 0xffffffff, MF_BYPOSITION|MF_ENABLED|MF_STRING, M_ID_SHOES, "&Shoes");
menuins(0, 0xffffffff, MF_BYPOSITION|MF_ENABLED|MF_STRING, M_ID_PLACES, "&Places");
menuins(0, 0xffffffff, MF_BYPOSITION|MF_ENABLED|MF_STRING, M_ID_HELP, "&Help");

You'll need to use menupopex() to provide sub menus for each item. There is a mechanism using the CEAPI library to create real submenus and attach them to the main menu items, but handling the results is difficult on the PocketPC.

You can change the File menu to anything you want by deleting it and inserting your own first item. You then have to provide your own sub menu though.

The cmdbar library (source) contains the code for calculating the Y position for the top of a menupopex() type menu so that the bottom aligns with the menu bar properly.

drawbitmap() takes a standard windows .BMP file as its parameter.

The original file menu separator has an ID of 0.



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
[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 Thorsten Godau on Wed Jul 31, 2002 4:30 pm

Dear Guy,

thank you very much for the answers.
I will test it in my holidays the next
3 weeks ;-))

Great forum with competent peoples!

Best regards, Thorsten
Thorsten Godau
 
Posts: 13
Joined: Tue Jul 30, 2002 3:12 pm
Location: Germany

Postby Thorsten Godau on Thu Aug 01, 2002 12:46 pm

Dear Guy,

i tried to manipulate the menubar with
help of your hints.
Unfortunately neither "File" can be deleted nor
tabs beside "File" can be created.
All items i create with your template are filled
at the top of "File" as a drop down menu.
Maybe it has to do with the PocketC runtime for
PPC 2002...

I will do some further tests...

Regards, Thorsten
Thorsten Godau
 
Posts: 13
Joined: Tue Jul 30, 2002 3:12 pm
Location: Germany

Postby Mickle on Mon Aug 05, 2002 3:17 pm

You must use DrawMenuBar(gethwnd(1)):

#include "/pocketc/winuser.h"

#define M_ID_FRUIT 300
#define M_ID_SHOES 301
#define M_ID_PLACES 302
#define M_ID_HELP 303

main()
{
menudel(0, MF_BYPOSITION, 0);
menuins(0, 0, MF_BYPOSITION|MF_ENABLED|MF_STRING, M_ID_FRUIT, "&Fruit");
menuins(0, 0xffffffff, MF_BYPOSITION|MF_ENABLED|MF_STRING, M_ID_SHOES, "&Shoes");
menuins(0, 0xffffffff, MF_BYPOSITION|MF_ENABLED|MF_STRING, M_ID_PLACES, "&Places");
menuins(0, 0xffffffff, MF_BYPOSITION|MF_ENABLED|MF_STRING, M_ID_HELP, "&Help");
DrawMenuBar(gethwnd(1));
}

Maybe it not will work on PPC2002 (?)

Mickle
Mickle
 
Posts: 48
Joined: Wed Apr 17, 2002 1:22 am
Location: Russia

Postby guy on Tue Aug 06, 2002 8:39 am

I've just added the command bar and toolbar functions to the CE API library.

I know that I said that I wouldn't do any more work on the library because I'd probably have to throw it all away for PocketC V4, but PocketC V4 is making no sign of appearing.

I'll add the PocketPC menu/tool bar functions as well, then upload it to the net.

You can get the hwnd for the command bar on non-PocketPC machines by checking which window occupies position 0,0 on the screen and is the full width of the screen. After that the command bar functions allow you to get the menu handle and play around with it.




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
[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 guy on Tue Aug 06, 2002 4:50 pm

Those of you who are observant will have noticed that a couple of my posts have been deleted from this thread. One was the one that said that CEAPI would be updated on Tuesday (2 days ago). Erm.

The other was a listing which has been superceded.

So, starting again:

New version of CEAPI library coming when I've stopped hitting the code with a big stick.

The new version allows you to write code that compiles under both evc and PocketC with the only conditional bits (#if...) around the #includes for the headers (path to header file) and the function return types in the function declarations and definitions.

You even get to have a main program called WinMain(). CEAPI provides the main() that PocketC likes to see.

All these features are optional. Unless you add a single #define at the top then you get your usual PocketC type main() program.

Just fighting one final gremlin (as have been doing for two days) in the window subclass and class wndproc handling.

Now, where's that hammer...


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


Edited by - guy on 08/08/2002 10:37:40
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


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 2 guests

cron