1 |
/******************************************************************************* |
= |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2005 IBM Corporation and others. |
|
2 |
* Copyright (c) 2000, 2005 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
|
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
|
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
|
5 |
* which accompanies this distribution, and is available at |
6 |
* http://www.eclipse.org/legal/epl-v10.html |
|
6 |
* http://www.eclipse.org/legal/epl-v10.html |
7 |
* |
|
7 |
* |
8 |
* Contributors: |
|
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
|
9 |
* IBM Corporation - initial API and implementation |
10 |
*******************************************************************************/ |
|
10 |
*******************************************************************************/ |
11 |
|
|
11 |
|
|
|
<> |
12 |
/******************************************************************************* |
|
|
|
13 |
* Additions/modifications to this source file by Oracle America, Inc. 2011 |
|
|
|
14 |
*******************************************************************************/ |
|
|
|
15 |
|
12 |
#pragma once |
= |
16 |
#pragma once |
13 |
//======================================================================================== |
|
17 |
//======================================================================================== |
14 |
#include "Ugl_Win32_widget.h" |
|
18 |
#include "Ugl_Win32_widget.h" |
15 |
#include "UGl_win32_display.h" |
|
19 |
#include "UGl_win32_display.h" |
16 |
#include "UGL_Win32_DC.h" |
|
20 |
#include "UGL_Win32_DC.h" |
17 |
|
|
21 |
|
18 |
//======================================================================================== |
|
22 |
//======================================================================================== |
19 |
/** |
|
23 |
/** |
20 |
* Macros for casting. |
|
24 |
* Macros for casting. |
21 |
*/ |
|
25 |
*/ |
22 |
#define UGL_MENU(handle) ((PUGL_Menu)handle) |
|
26 |
#define UGL_MENU(handle) ((PUGL_Menu)handle) |
23 |
#define UGL_MENUITEM(handle) ((PUGL_MenuItem)handle) |
|
27 |
#define UGL_MENUITEM(handle) ((PUGL_MenuItem)handle) |
24 |
//======================================================================================== |
|
28 |
//======================================================================================== |
25 |
|
|
29 |
|
26 |
struct UGL_MenuItem; |
|
30 |
struct UGL_MenuItem; |
27 |
|
|
31 |
|
28 |
typedef struct UGL_Menu { |
|
32 |
typedef struct UGL_Menu { |
29 |
UGL_Widget widget; |
|
33 |
UGL_Widget widget; |
30 |
struct UGL_Control* parent; |
|
34 |
struct UGL_Control* parent; |
31 |
struct UGL_MenuItem* cascadeItem; // Only used by drop down menus |
|
35 |
struct UGL_MenuItem* cascadeItem; // Only used by drop down menus |
32 |
HMENU hMenu; |
|
36 |
HMENU hMenu; |
33 |
int id; |
|
37 |
int id; |
34 |
|
|
38 |
|
35 |
#ifdef _WIN32_WCE |
|
39 |
#ifdef _WIN32_WCE |
36 |
HWND hwndCB; |
|
40 |
HWND hwndCB; |
37 |
HWND hwndMB; // for softkey with menu |
|
41 |
HWND hwndMB; // for softkey with menu |
38 |
#else |
|
42 |
#else |
39 |
BOOL isMenuBar; |
|
43 |
BOOL isMenuBar; |
40 |
#endif |
|
44 |
#endif |
41 |
} UGL_Menu, *PUGL_Menu; |
|
45 |
} UGL_Menu, *PUGL_Menu; |
42 |
//======================================================================================== |
|
46 |
//======================================================================================== |
43 |
|
|
47 |
|
44 |
typedef struct UGL_MenuItem { |
|
48 |
typedef struct UGL_MenuItem { |
45 |
UGL_Widget widget; |
|
49 |
UGL_Widget widget; |
46 |
PUGL_Menu parent_menu; |
|
50 |
PUGL_Menu parent_menu; |
47 |
int id; |
|
51 |
int id; |
48 |
PUGL_Image ugl_image; |
|
52 |
PUGL_Image ugl_image; |
49 |
PUGL_Menu dropDownMenu; // Only used by CascadeMenuItems |
|
53 |
PUGL_Menu dropDownMenu; // Only used by CascadeMenuItems |
50 |
int index; // new for softkey support |
|
54 |
int index; // new for softkey support |
51 |
UGL_String text; // new for softkey support |
|
55 |
UGL_String text; // new for softkey support |
52 |
BOOL hasSubMenu; // new for softkey support |
|
56 |
BOOL hasSubMenu; // new for softkey support |
53 |
BOOL enabled; |
|
57 |
BOOL enabled; |
54 |
BOOL isSeparator; |
|
58 |
BOOL isSeparator; |
|
|
-+ |
59 |
BOOL disableAutoSelection; |
|
|
|
60 |
BOOL isSelected; |
55 |
|
= |
61 |
|
56 |
// used to override function if needed |
|
62 |
// used to override function if needed |
57 |
WM_COMMANDCHILD wmDrawChild; |
|
63 |
WM_COMMANDCHILD wmDrawChild; |
58 |
WM_COMMANDCHILD wmMeasureChild; |
|
64 |
WM_COMMANDCHILD wmMeasureChild; |
59 |
WM_COMMANDCHILD wmCommandChild; |
|
65 |
WM_COMMANDCHILD wmCommandChild; |
60 |
|
|
66 |
|
61 |
LPACCEL accel_entry; // Menu_SetAccelerator-related |
|
67 |
LPACCEL accel_entry; // Menu_SetAccelerator-related |
62 |
} UGL_MenuItem, *PUGL_MenuItem; |
|
68 |
} UGL_MenuItem, *PUGL_MenuItem; |
63 |
//======================================================================================== |
|
69 |
//======================================================================================== |
64 |
|
|
70 |
|
65 |
PUGL_Menu _MenuBar_New(PUGL_Control shell, UGL_Error error); |
|
71 |
PUGL_Menu _MenuBar_New(PUGL_Control shell, UGL_Error error); |
66 |
UGL_Int _PopupMenu_New(UGL_Int shellHandle, UGL_Error uglError); |
|
72 |
UGL_Int _PopupMenu_New(UGL_Int shellHandle, UGL_Error uglError); |
67 |
void _Dispose_Menu(UGL_Int handle, UGL_Error uglError); |
|
73 |
void _Dispose_Menu(UGL_Int handle, UGL_Error uglError); |
68 |
|
|
74 |
|