Jeff's updates

import/tags/KMELEON_0_4
binaryc 22 years ago
parent 7440a416ba
commit f41e5d91cc
  1. 32
      k-meleon/BrowserView.cpp
  2. 9
      k-meleon/BrowserView.h
  3. 27
      k-meleon/KMeleon.dsp
  4. 20
      k-meleon/ToolBarEx.cpp
  5. 5
      k-meleon/ToolBarEx.h
  6. 1
      k-meleon/defineMap.cpp

@ -85,8 +85,10 @@ BEGIN_MESSAGE_MAP(CBrowserView, CWnd)
ON_COMMAND(ID_VIEW_INFO, OnViewInfo)
ON_COMMAND(ID_NAV_BACK, OnNavBack)
ON_COMMAND(ID_NAV_FORWARD, OnNavForward)
ON_MESSAGE(WM_LBUTTONHOLD, OnLButtonHold)
ON_NOTIFY(NM_RCLICK,AFX_IDW_TOOLBAR,OnRClick)
ON_MESSAGE(TB_LBUTTONHOLD, OnTBLButtonHold)
ON_MESSAGE(TB_RBUTTONDOWN, OnTBRButtonDown)
ON_COMMAND(ID_NAV_SEARCH, OnNavSearch)
ON_COMMAND(ID_NAV_HOME, OnNavHome)
ON_COMMAND(ID_NAV_RELOAD, OnNavReload)
@ -421,32 +423,30 @@ void CBrowserView::OnNavForward()
// Jeff Doozan - 28 Feb, 2001
void CBrowserView::OnRClick(NMHDR* pNotifyStruct,LRESULT* result) {
NMTOOLBAR* pInfo = (NMTOOLBAR*)pNotifyStruct;
switch(pInfo->iItem) {
void CBrowserView::OnTBRButtonDown(WPARAM controlID, LPARAM lParam) {
switch(controlID) {
case ID_NAV_BACK:
TRACE0("ID_NAV_BACK right click\n");
CreateBackMenu();
CreateBackMenu(TPM_RIGHTBUTTON);
break;
case ID_NAV_FORWARD:
TRACE0("ID_NAV_FORWARD right click\n");
CreateForwardMenu();
CreateForwardMenu(TPM_RIGHTBUTTON);
break;
}
}
void CBrowserView::OnLButtonHold(DWORD buttonID, DWORD unused) {
void CBrowserView::OnTBLButtonHold(DWORD buttonID, DWORD unused) {
CBrowserFrame *mainFrame = (CBrowserFrame *) theApp.m_pMainWnd->GetActiveWindow();
switch (buttonID) {
case ID_NAV_BACK:
TRACE0("ID_NAV_BACK held\n");
CreateBackMenu();
CreateBackMenu(TPM_LEFTBUTTON);
break;
case ID_NAV_FORWARD:
TRACE0("ID_NAV_FORWARD held\n");
CreateForwardMenu();
CreateForwardMenu(TPM_LEFTBUTTON);
break;
}
}
@ -1027,7 +1027,7 @@ BOOL CBrowserView::PreTranslateMessage(MSG* pMsg) {
// Jeff Doozan - 28 Feb, 2001
void CBrowserView::CreateBackMenu () {
void CBrowserView::CreateBackMenu (UINT button) {
int index, count, i;
char **titles;
@ -1049,7 +1049,8 @@ void CBrowserView::CreateBackMenu () {
WPARAM ButtonID = mainFrame->m_wndToolBar.CommandToIndex(ID_NAV_BACK);
mainFrame->m_wndToolBar.GetItemRect(ButtonID, &rc);
mainFrame->m_wndToolBar.ClientToScreen(&rc);
DWORD SelectionMade = submenu.TrackPopupMenu( TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, rc.left, rc.bottom, this, &rc);
// DWORD SelectionMade = submenu.TrackPopupMenu( TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, rc.left, rc.bottom, this, &rc);
DWORD SelectionMade = submenu.TrackPopupMenu( TPM_LEFTALIGN | button | TPM_NONOTIFY | TPM_RETURNCMD, rc.left, rc.bottom, this, &rc);
submenu.Detach();
submenu.DestroyMenu();
@ -1065,7 +1066,7 @@ void CBrowserView::CreateBackMenu () {
}
}
void CBrowserView::CreateForwardMenu () {
void CBrowserView::CreateForwardMenu (UINT button) {
int index, count, i;
char **titles;
CBrowserFrame *mainFrame = (CBrowserFrame *) theApp.m_pMainWnd->GetActiveWindow();
@ -1086,7 +1087,8 @@ void CBrowserView::CreateForwardMenu () {
WPARAM ButtonID = mainFrame->m_wndToolBar.CommandToIndex(ID_NAV_FORWARD);
mainFrame->m_wndToolBar.GetItemRect(ButtonID, &rc);
mainFrame->m_wndToolBar.ClientToScreen(&rc);
DWORD SelectionMade = submenu.TrackPopupMenu( TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, rc.left, rc.bottom, this, &rc);
// DWORD SelectionMade = submenu.TrackPopupMenu( TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, rc.left, rc.bottom, this, &rc);
DWORD SelectionMade = submenu.TrackPopupMenu( TPM_LEFTALIGN | button | TPM_NONOTIFY | TPM_RETURNCMD, rc.left, rc.bottom, this, &rc);
submenu.Detach();
submenu.DestroyMenu();

@ -71,8 +71,8 @@ public:
void SetBrowserFrameGlue(PBROWSERFRAMEGLUE pBrowserFrameGlue);
PBROWSERFRAMEGLUE mpBrowserFrameGlue;
void CreateBackMenu ();
void CreateForwardMenu ();
void CreateBackMenu (UINT button);
void CreateForwardMenu (UINT button);
int MozillaSessionHistory(char **titles[], int *count, int *index);
// Pointer to the object which implements
@ -131,10 +131,9 @@ protected:
afx_msg void OnNavBack();
afx_msg void OnNavForward();
afx_msg void OnLButtonHold(DWORD buttonID, DWORD unused);
afx_msg void OnTBLButtonHold(DWORD buttonID, DWORD unused);
afx_msg void OnTBRButtonDown(WPARAM controlID, LPARAM lParam);
afx_msg void OnDropDown(NMHDR* pNotifyStruct,LRESULT* result);
afx_msg void OnRClick(NMHDR* pNotifyStruct,LRESULT* result);
afx_msg void OnNavSearch();
afx_msg void OnNavHome();
afx_msg void OnNavReload();

@ -43,7 +43,8 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\mozilla\mozilla\nsprpub\pr\include" /I "..\mozilla\mozilla\nsprpub\_o.obj\include" /I "..\mozilla\mozilla\include" /I "..\mozilla\mozilla\xpcom\components" /I "..\mozilla\mozilla\dist\include" /I "..\mozilla\mozilla\dist\WIN32_O.OBJ\include" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "HW_THREADS" /D "XP_PC" /D "XP_WIN" /D "XP_WIN32" /D WINVER=0x400 /FR /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\mozilla\mozilla\nsprpub\pr\include" /I "..\mozilla\mozilla\nsprpub\_o.obj\include" /I "..\mozilla\mozilla\include" /I "..\mozilla\mozilla\xpcom\components" /I "..\mozilla\mozilla\dist\include" /I "..\mozilla\mozilla\dist\WIN32_O.OBJ\include" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "HW_THREADS" /D "XP_PC" /D "XP_WIN" /D "XP_WIN32" /D WINVER=0x400 /D _WIN32_IE=0x0500 /Yu"stdafx.h" /FD /c
# SUBTRACT CPP /Fr
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
@ -53,7 +54,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 xpcom.lib baseembed_s.lib plc4.lib /nologo /subsystem:windows /machine:I386 /out:"..\mozilla\mozilla\dist\WIN32_o.OBJ\bin\k-meleon.exe" /libpath:"c:\projects\mozilla\mozilla\dist\win32_o.obj\lib" /libpath:"..\mozilla\mozilla\dist\WIN32_o.OBJ\lib"
# ADD LINK32 xpcom.lib baseembed_s.lib plc4.lib /nologo /subsystem:windows /machine:I386 /out:"..\mozilla\mozilla\dist\WIN32_o.OBJ\Embed\k-meleon.exe" /libpath:"c:\projects\mozilla\mozilla\dist\win32_o.obj\lib" /libpath:"..\mozilla\mozilla\dist\WIN32_o.OBJ\lib"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "kmeleon - Win32 Debug"
@ -80,7 +81,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 xpcom.lib baseembed_s.lib /nologo /subsystem:windows /debug /machine:I386 /out:"..\mozilla\mozilla\dist\WIN32_o.OBJ\bin\k-meleon.exe" /pdbtype:sept /libpath:"..\mozilla\mozilla\dist\WIN32_o.OBJ\lib"
# ADD LINK32 xpcom.lib baseembed_s.lib /nologo /subsystem:windows /debug /machine:I386 /out:"..\mozilla\mozilla\dist\WIN32_o.OBJ\Embed\k-meleon.exe" /pdbtype:sept /libpath:"..\mozilla\mozilla\dist\WIN32_o.OBJ\lib"
!ENDIF
@ -129,6 +130,10 @@ SOURCE=.\Dialogs.cpp
# End Source File
# Begin Source File
SOURCE=.\MenuEx.cpp
# End Source File
# Begin Source File
SOURCE=.\MenuParser.cpp
# End Source File
# Begin Source File
@ -170,6 +175,10 @@ SOURCE=.\ToolBarEx.cpp
# End Source File
# Begin Source File
SOURCE=.\ToolBarWrapper.cpp
# End Source File
# Begin Source File
SOURCE=.\Utils.cpp
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
@ -212,6 +221,10 @@ SOURCE=.\kmeleon_plugin.h
# End Source File
# Begin Source File
SOURCE=.\MenuEx.h
# End Source File
# Begin Source File
SOURCE=.\MenuParser.h
# End Source File
# Begin Source File
@ -248,6 +261,10 @@ SOURCE=.\ToolBarEx.h
# End Source File
# Begin Source File
SOURCE=.\ToolBarWrapper.h
# End Source File
# Begin Source File
SOURCE=.\Utils.h
# End Source File
# Begin Source File
@ -308,6 +325,10 @@ SOURCE=.\res\MozillaBrowser.ico
# End Source File
# Begin Source File
SOURCE=.\res\temp.bmp
# End Source File
# Begin Source File
SOURCE=.\res\Tool1.bmp
# End Source File
# Begin Source File

@ -17,7 +17,7 @@
*
* Extended CToolBar class, processes WM_LBUTTONDOWN and WM_LBUTTONUP messages
* if a button is pressed for longer than 300ms, the event WM_LBUTTONHOLD is
* if a button is pressed for longer than 300ms, the event TB_LBUTTONHOLD is
* sent to the BrowserView window.
*
@ -50,6 +50,7 @@ CToolBarEx::~CToolBarEx()
BEGIN_MESSAGE_MAP(CToolBarEx, CToolBar)
//{{AFX_MSG_MAP(CToolBarEx)
ON_WM_RBUTTONDOWN()
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_TIMER()
@ -96,13 +97,28 @@ void CToolBarEx::OnLButtonUp(UINT nFlags, CPoint point) {
CToolBar::OnLButtonUp(nFlags, point);
}
void CToolBarEx::OnRButtonDown(UINT nFlags, CPoint point) {
int count = GetToolBarCtrl().GetButtonCount();
CRect buttonRect;
for (int n = 0; n < count; n++) {
GetItemRect(n, &buttonRect);
if (buttonRect.PtInRect(point)) {
CBrowserFrame *mainFrame = (CBrowserFrame *)theApp.m_pMainWnd->GetActiveWindow();
mainFrame->m_wndBrowserView.PostMessage(TB_RBUTTONDOWN, GetItemID(n), 0);
break;
}
}
}
void CToolBarEx::OnTimer(UINT nIDEvent) {
if (nIDEvent <= (UINT) GetToolBarCtrl().GetButtonCount()) {
KillTimer(nIDEvent);
CBrowserFrame *mainFrame = (CBrowserFrame *)theApp.m_pMainWnd->GetActiveWindow();
mainFrame->m_wndBrowserView.PostMessage(WM_LBUTTONHOLD, GetItemID(nIDEvent-1), 0);
mainFrame->m_wndBrowserView.PostMessage(TB_LBUTTONHOLD, GetItemID(nIDEvent-1), 0);
}
CToolBar::OnTimer(nIDEvent);

@ -26,8 +26,8 @@
//
#define WM_LBUTTONHOLD WM_APP + 123
#define TB_LBUTTONHOLD WM_APP + 120
#define TB_RBUTTONDOWN WM_APP + 121
/////////////////////////////////////////////////////////////////////////////
@ -59,6 +59,7 @@ protected:
//{{AFX_MSG(CToolBarEx)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG

@ -17,6 +17,7 @@ DEFINEMAP_ADD(ID_NEW_BROWSER)
DEFINEMAP_ADD(ID_FILE_SAVE_AS)
DEFINEMAP_ADD(ID_FILE_OPEN)
DEFINEMAP_ADD(ID_FILE_CLOSE)
DEFINEMAP_ADD(ID_FILE_PRINT)
DEFINEMAP_ADD(ID_EDIT_CUT)
DEFINEMAP_ADD(ID_EDIT_COPY)
DEFINEMAP_ADD(ID_EDIT_PASTE)

Loading…
Cancel
Save