April 29, 2024, 03:59:16 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Office menu v2

Started by sapero, November 14, 2008, 09:45:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sapero

November 14, 2008, 09:45:19 AM Last Edit: November 16, 2008, 07:23:23 AM by sapero
latest version link

This is converted version from Aurora forum, with small addition that allowed me to handle three different menus: system, window and context menu.
In this example the system menu and window menu are styled.

I have added four properties to main window:
"WindowMenu" - holds pointer to COfficeMenuBase class with window menu attached
"SystemMenu" - same, for system menu
"ContextMenu" - same, for context menu
"CurrentMenu" - currently active menu (window menu by default).

CurrentMenu switching is done internally, you need only to initialize properties - see in sub main()

Please update your includes before compiling - two fixed gdiplus headers are in "include update" subfolder.

todo's:
Menu bitmaps are still not correctly handled.
Some items from system menu (minimize, maximize and close) are not resized (no message received). I think I need to delete and insert these items to get it working.


EDIT: in main.eba, please find line with PostQuitMessage, and replace (whole line) with$ifndef USE_EBASIC_WINDOW
PostQuitMessage(0)
$endif

Please also replace WM_CONTEXTMENU with WM_RBUTTONUP, or at least forward this message to default handler, because the system menu may not appear when clicking on window caption.

gjaking

1000 thanks sapero  ;)
this is a great work !!!  :P


Rock Ridge Farm (Larry)

I am running a complete new install on a new computer.
I am missing windowssdk.inc - where should I look to get this file?

sapero

November 14, 2008, 12:02:41 PM #3 Last Edit: November 14, 2008, 12:07:16 PM by sapero
On the Ionic Wind homepage in downloads section, or click the link my sig and choose rapidshare or sendspace.
If you choose rapidshare, you'll give me a thankyou-point for your download. For 10k points I can become one month of premium account for free.

sapero

I have attached second (really it is the third) release. Fixed system menu, added context menu. Added also code for the context menu handler to change active menu (sub DlgProc, WM_RBUTTONUP).

Major change in HandleMessage method - none from WM_NC* messages is blocking. Added handler for WM_UNINITMENUPOPUP to detect when the system menu is closing.
All items from system menu are resized now - a 'remove and insert item' was neccesary.
Bitmaps are now supported - by handle, or one based index.
Added not working Detach method :) I think nobody will need to detach styles, so this method could be removed. Or?

pistol350

Hi sapero.

In which step of using rapidshare can one give a thankyou point ?
I tried redownload the paks but did not see any additional options that lead to give credit to the uploader.
Regards,

Peter B.

sapero

Quote from faq: You get a RapidPoint for each download, provided that the file is bigger than 5 megabyte and the user has not generated more than 3 RapidPoints in the last hour.

Rock Ridge Farm (Larry)

I still can not get this to compile on a new laptop with vista.
It has issues with the local include files.

sapero

Larry, what errors do you have?

Rock Ridge Farm (Larry)

Compiling...
main
File: C:\Users\lsikes\Desktop\ebrad\main.eba (28) Warning: Uninitialized variable: mmenu
File: C:\Users\lsikes\Desktop\ebrad\main.eba (29) Warning: Uninitialized variable: sysmenu
File: C:\Users\lsikes\Desktop\ebrad\main.eba (30) Warning: Uninitialized variable: ctxmenu
File: C:\Users\lsikes\Desktop\ebrad\main.eba (51) undefined variable - menu - )
File: C:\Users\lsikes\Desktop\ebrad\main.eba (51) Invalid & operation - )
File: C:\Users\lsikes\Desktop\ebrad\main.eba (54) undefined variable - menu - )
File: C:\Users\lsikes\Desktop\ebrad\main.eba (54) Invalid & operation - )
File: C:\Users\lsikes\Desktop\ebrad\main.eba (59) undefined variable - menu
File: C:\Users\lsikes\Desktop\ebrad\main.eba (59) unknown class
File: C:\Users\lsikes\Desktop\ebrad\main.eba (60) undefined variable - menu
File: C:\Users\lsikes\Desktop\ebrad\main.eba (60) unknown class
File: C:\Users\lsikes\Desktop\ebrad\main.eba (62) undefined variable - menu
File: C:\Users\lsikes\Desktop\ebrad\main.eba (62) invalid use of dot operator, unknown type
File: C:\Users\lsikes\Desktop\ebrad\main.eba (70) undefined variable - menu - )
File: C:\Users\lsikes\Desktop\ebrad\main.eba (70) invalid use of dot operator, unknown type - )
File: C:\Users\lsikes\Desktop\ebrad\main.eba (73) undefined variable - menu - )
File: C:\Users\lsikes\Desktop\ebrad\main.eba (73) invalid use of dot operator, unknown type - )
File: C:\Users\lsikes\Desktop\ebrad\main.eba (192) Warning: Uninitialized variable: img
Error(s) in compiling C:\Users\lsikes\Desktop\ebrad\main.eba

Rock Ridge Farm (Larry)

I downloaded the latest version - now it compiles with the following warnings
Compiling Resources...
No Errors

Compiling...
main
File: C:\Users\lsikes\Desktop\ebrad\main.eba (28) Warning: Uninitialized variable: wndmenu
File: C:\Users\lsikes\Desktop\ebrad\main.eba (29) Warning: Uninitialized variable: sysmenu
File: C:\Users\lsikes\Desktop\ebrad\main.eba (30) Warning: Uninitialized variable: ctxmenu
File: C:\Users\lsikes\Desktop\ebrad\main.eba (222) Warning: Uninitialized variable: img
OfficeMenu

Linking...
Emergence Linker v1.11 Copyright ÂÃ,© 2006 Ionic Wind Software
Generating OfficeMenu.exe
Build completed

When executed it crashes - I am running this on Vista Home.

Rock Ridge Farm (Larry)

The debug data from the crash:
Starting debug session...
Loading DLL: ntdll.dll
Loading DLL: C:\Windows\system32\kernel32.dll
Loading DLL: C:\Windows\system32\GDI32.DLL
Loading DLL: C:\Windows\system32\USER32.dll
Loading DLL: C:\Windows\system32\ADVAPI32.dll
Loading DLL: C:\Windows\system32\RPCRT4.dll
Loading DLL: C:\Windows\system32\OLE32.DLL
Loading DLL: C:\Windows\system32\msvcrt.dll
Loading DLL: C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1dfw
Loading DLL: C:\Windows\system32\MSIMG32.DLL
Loading DLL: C:\Windows\system32\CRTDLL.DLL
Loading DLL: C:\Windows\system32\IMM32.DLL
Loading DLL: C:\Windows\system32\MSCTF.dll
Loading DLL: C:\Windows\system32\LPK.DLL
Loading DLL: C:\Windows\system32\USP10.dll
Loading DLL: C:\Windows\system32\avgrsstx.dll
Loading DLL: C:\Windows\system32\uxtheme.dll
Loading DLL: C:\Program Files\McAfee\SiteAdvisor\saHook.dll
First chance exception: Address 0x4D525453 Access Violation.
Final chance exception: Address 0x4D525453 Access Violation.

Call stack:
<unknown>! <missing symbols>
<unknown>! <missing symbols>
OfficeMenu! <missing symbols>
OfficeMenu! <missing symbols>
OfficeMenu! <missing symbols>
<unknown>! <missing symbols>
<unknown>! <missing symbols>
<unknown>! <missing symbols>


sapero

0x4D525453 must be inside gdiplus module. If you debug it in real debugger, you'll see"return to gdiplus" in call-stack window.
Did you updated included two gdi+ headers ? You need to replace two files in include directory.
You can also update the code in main.eba by adding "+0" to three variables:
GdipLoadImageFromStream(stream +0, &img)
GdipCreateHBITMAPFromBitmap(img +0, &bitmap, 0)
GdipDisposeImage(img +0)

sapero

I have finished it.
If an item is disabled, its bitmap will be grayed. The way you assign image index to menu item has changed - image (by index) is extracted and assigned to menu item as checkmarks.
Please remember to call SetActiveMenu before displaying context menu. It may be automated only if you ensure different menu item id's for context menu and the window menu.

Rock Ridge Farm (Larry)

Downloaded the latest - it compiles and runs.
I do get the warnings at compile:
Compiling Resources...
No Errors

Compiling...
main
File: C:\Users\lsikes\Desktop\ebrad\main.eba (61) Warning: Uninitialized variable: wndmenu
File: C:\Users\lsikes\Desktop\ebrad\main.eba (62) Warning: Uninitialized variable: sysmenu
File: C:\Users\lsikes\Desktop\ebrad\main.eba (63) Warning: Uninitialized variable: ctxmenu
OfficeMenu
png

Linking...
Emergence Linker v1.11 Copyright ÂÃ,© 2006 Ionic Wind Software
Generating OfficeMenu.exe
Build completed