source: branches/v2.9/mediafolder/c/cdfldr/cdfldrdialogprocs.cpp

Last change on this file was 2, checked in by stevenhl, 8 years ago

Import sources from cwmm-full.zip dated 2005-03-21

File size: 4.7 KB
Line 
1/*
2 * This file is (C) Chris Wohlgemuth 2002
3 * It is part of the MediaFolder package
4 */
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20#define INCL_GPILCIDS
21#define INCL_GPIPRIMITIVES
22#define INCL_GPIBITMAPS
23#define INCL_SW
24
25#include "mediafolderres.h"
26
27
28#include <stdio.h>
29#include <stdlib.h>
30
31#include "cdfolder.hh"
32
33
34extern HMODULE hResource;
35extern PFNWP pfnwpGenericCDFrame;
36
37/* Extern */
38BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
39MRESULT cwInsertMenuItem(int iPosition, HWND hwndMenu, HWND hwndSubMenu, int iID, char * chrText);
40MRESULT cwInsertMenuSeparator(int iPosition, HWND hwndMenu, HWND hwndSubMenu);
41
42void writeLogPrintf(char* logFile, char* format, ...);
43
44
45extern SOMClass* cwGetSomClass(char* chrClassName);
46
47/************************************************************
48 * *
49 * This frame proc handles the about menuitem of the *
50 * Warp 4 menu bar and removes the Tree view item. *
51 * *
52************************************************************/
53MRESULT EXPENTRY cdFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
54{
55 CWCDFolder* thisPtr;
56 HWND hwndDialog;
57 MENUITEM mi;
58 char text[100];
59
60 switch (msg)
61 {
62 case WM_INITMENU:
63 if((hwndDialog=WinWindowFromID(hwnd,IDDLG_TOPFRAME))!=NULLHANDLE)
64 {
65 thisPtr=(CWCDFolder*) WinQueryWindowULong(hwndDialog,QWL_USER);
66 if(somIsObj(thisPtr)) {
67 switch(thisPtr->usLastSelMenuItem)
68 {
69 case 0x2d1: /* view menu */
70 /* Remove change to icon view from menubar menu */
71 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT(0x2cc,TRUE),0);
72 /* Remove sort from menubar. It's already disabled but anyway... */
73 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT( 5,TRUE),0);
74 /* Remove arrange from menubar. It's already disabled but anyway... */
75 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT( 0x135,TRUE),0);
76 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT( 0x136,TRUE),0);
77
78 break;
79 case 0x2d0: /* edit menu */
80 /* The following are for a content object */
81 /* Remove create from menubar */
82 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT(0x65,TRUE),0);
83 /* Remove move from menubar */
84 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT(0x6b,TRUE),0);
85 /* Remove copy from menubar */
86 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT(0x6c,TRUE),0);
87 /* Remove insert from menubar */
88 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT(0x2cb,TRUE),0);
89 /* Remove delete from menubar */
90 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT(0x6d,TRUE),0);
91 /* Remove create shadow from menubar */
92 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT(0x13c,TRUE),0);
93 break;
94 case 0x2cf: /* Folder menu */
95 /* Remove copy from menubar */
96 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT(0x6c,TRUE),0);
97 /* Remove create from menubar */
98 WinSendMsg(HWNDFROMMP(mp2),MM_REMOVEITEM,MPFROM2SHORT(0x65,TRUE),0);
99 default:
100 break;
101 }
102 }
103 }
104 break;
105 default:
106 break;
107 }
108 /* Any other message is handled by the folder frame procedure */
109 if((hwndDialog=WinWindowFromID(hwnd,IDDLG_TOPFRAME))!=NULLHANDLE)
110 {
111 thisPtr=(CWCDFolder*) WinQueryWindowULong(hwndDialog,QWL_USER);
112 if(somIsObj(thisPtr)) {
113 if(thisPtr->pfnwpCDFrame)
114 return thisPtr->pfnwpCDFrame(hwnd, msg, mp1, mp2);
115 }
116 }
117 return pfnwpGenericCDFrame(hwnd, msg, mp1, mp2);
118
119}
120
121
122
123
Note: See TracBrowser for help on using the repository browser.