ReactOS  0.4.12-dev-75-g00dd17e
SDIMainFrame Struct Reference

#include <mainframe.h>

Inheritance diagram for SDIMainFrame:
Collaboration diagram for SDIMainFrame:

Public Types

typedef ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > > super
 
- Public Types inherited from ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >
typedef ShellBrowserChildT< MainFrameBasesuper
 
- Public Types inherited from ShellBrowserChildT< MainFrameBase >
typedef MainFrameBase super
 
- Public Types inherited from MainFrameBase
typedef PreTranslateWindow super
 
- Public Types inherited from PreTranslateWindow
typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 

Public Member Functions

 SDIMainFrame (HWND hwnd)
 
- Public Member Functions inherited from ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >
 ExtContextMenuHandlerT (HWND hwnd)
 
 ExtContextMenuHandlerT (HWND hwnd, const PARA &info)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Public Member Functions inherited from ShellBrowserChildT< MainFrameBase >
 ShellBrowserChildT (HWND hwnd)
 
 ShellBrowserChildT (HWND hwnd, const ShellChildWndInfo &info)
 
- Public Member Functions inherited from MainFrameBase
 MainFrameBase (HWND hwnd)
 
 ~MainFrameBase ()
 
- Public Member Functions inherited from PreTranslateWindow
 PreTranslateWindow (HWND)
 
 ~PreTranslateWindow ()
 
- Public Member Functions inherited from Window
 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
- Public Member Functions inherited from BrowserCallback
virtual ~BrowserCallback ()
 

Static Public Member Functions

static HWND Create ()
 
static HWND Create (LPCTSTR path, int mode=OWM_EXPLORE|OWM_DETAILS)
 
static HWND Create (LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL)
 
- Static Public Member Functions inherited from MainFrameBase
static HWND Create (const ExplorerCmd &cmd)
 
static int OpenShellFolders (LPIDA pida, HWND hFrameWnd)
 
- Static Public Member Functions inherited from Window
static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle More...
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
int Command (int id, int code)
 
void resize_frame (int cx, int cy)
 
void resize_children ()
 
void update_clnt_rect ()
 
void update_shell_browser ()
 
void jump_to (LPCTSTR path, int mode)
 
void jump_to (LPCITEMIDLIST path, int mode)
 
virtual void entry_selected (Entry *entry)
 
void set_url (LPCTSTR url)
 
- Protected Member Functions inherited from ShellBrowserChildT< MainFrameBase >
int Notify (int id, NMHDR *pnmh)
 
- Protected Member Functions inherited from MainFrameBase
bool ProcessMessage (UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT *pres)
 
virtual BOOL TranslateMsg (MSG *pmsg)
 
void toggle_child (HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1)
 
void resize_frame_client ()
 
virtual void frame_get_clientspace (PRECT prect)
 
BOOL toggle_fullscreen ()
 
void fullscreen_move ()
 
void FillBookmarks ()
 
virtual bool go_to (LPCTSTR url, bool new_window)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 

Protected Attributes

ShellPathInfo _shellpath_info
 
WindowHandle _left_hwnd
 
WindowHandle _right_hwnd
 
int _split_pos
 
int _last_split
 
RECT _clnt_rect
 
String _url
 
- Protected Attributes inherited from ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >
CtxMenuInterfaces _cm_ifs
 
- Protected Attributes inherited from ShellBrowserChildT< MainFrameBase >
auto_ptr< ShellBrowser_shellBrowser
 
- Protected Attributes inherited from MainFrameBase
FullScreenParameters _fullscreen
 
HACCEL _hAccel
 
HIMAGELIST _himl_old
 

Additional Inherited Members

- Public Attributes inherited from MainFrameBase
WindowHandle _hwndrebar
 
WindowHandle _htoolbar
 
WindowHandle _haddrcombo
 
WindowHandle _hstatusbar
 
WindowHandle _hsidebar
 
HIMAGELIST _himl
 
HMENU _hMenuFrame
 
HMENU _hMenuWindow
 
MenuInfo _menu_info
 
- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 
- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window More...
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
- Static Protected Attributes inherited from Window
static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

Definition at line 137 of file mainframe.h.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ SDIMainFrame()

SDIMainFrame::SDIMainFrame ( HWND  hwnd)

Definition at line 1332 of file mainframe.cpp.

1333  : super(hwnd)
1334 {
1337 
1338  /* wait for PM_OPEN_WINDOW message before creating a shell view
1339  update_shell_browser();*/
1340 }
#define DEFAULT_SPLIT_POS
Definition: window.h:270
int _last_split
Definition: mainframe.h:162
int _split_pos
Definition: mainframe.h:161
ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > > super
Definition: mainframe.h:143

Member Function Documentation

◆ Command()

int SDIMainFrame::Command ( int  id,
int  code 
)
protectedvirtual

Reimplemented from MainFrameBase.

Definition at line 1522 of file mainframe.cpp.

1523 {
1524  switch(id) {
1525  case ID_VIEW_MDI:
1527  break;
1528 
1529  default:
1530  return super::Command(id, code);
1531  }
1532 
1533  return 0;
1534 }
Explorer command line parser.
Definition: explorer.h:89
int Command(int id, int code)
Definition: mainframe.cpp:388
static HWND Create(const ExplorerCmd &cmd)
Definition: mainframe.cpp:40
String _url
Definition: mainframe.h:165
#define ID_VIEW_MDI
Definition: resource.h:220

◆ Create() [1/3]

HWND SDIMainFrame::Create ( )
static

Definition at line 1342 of file mainframe.cpp.

Referenced by StartMenuHandler::Command(), MainFrameBase::Create(), Create(), and MainFrameBase::OpenShellFolders().

1343 {
1345 
1349  0/*hwndDesktop*/, hMenuFrame);
1350 }
#define WINDOW_CREATOR(WND_CLASS)
Definition: window.h:202
#define MAKEINTRESOURCE
Definition: winuser.h:591
ATOM _hframeClass
Definition: globals.h:274
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define IDM_SDIFRAME
Definition: resource.h:69
#define CW_USEDEFAULT
Definition: winuser.h:225
static HWND Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
Definition: window.cpp:87
#define IDS_TITLE
Definition: resource.h:30
HINSTANCE _hInstance
Definition: globals.h:270
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
HMENU hMenuFrame
Definition: main.c:32
#define LoadMenu
Definition: winuser.h:5683
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
convenient loading of string resources
Definition: globals.h:303
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

◆ Create() [2/3]

HWND SDIMainFrame::Create ( LPCTSTR  path,
int  mode = OWM_EXPLORE|OWM_DETAILS 
)
static

Definition at line 1368 of file mainframe.cpp.

1369 {
1370  HWND hFrame = Create();
1371  if (!hFrame)
1372  return 0;
1373 
1374  ShowWindow(hFrame, SW_SHOW);
1375 
1376  MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame);
1377 
1378  if (pMainFrame)
1379  pMainFrame->CreateChild(path, mode);
1380 
1381  return hFrame;
1382 }
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static HWND Create()
Definition: mainframe.cpp:1342
#define SW_SHOW
Definition: winuser.h:769
ChildWindow * CreateChild(LPCTSTR path=NULL, int mode=OWM_EXPLORE|OWM_DETAILS)
Definition: mainframe.cpp:909
#define GET_WINDOW(CLASS, hwnd)
Definition: window.h:88
Definition: services.c:325

◆ Create() [3/3]

HWND SDIMainFrame::Create ( LPCITEMIDLIST  pidl,
int  mode = OWM_EXPLORE|OWM_DETAILS|OWM_PIDL 
)
static

Definition at line 1352 of file mainframe.cpp.

1353 {
1354  HWND hFrame = Create();
1355  if (!hFrame)
1356  return 0;
1357 
1358  ShowWindow(hFrame, SW_SHOW);
1359 
1360  SDIMainFrame* pFrame = GET_WINDOW(SDIMainFrame, hFrame);
1361 
1362  if (pFrame)
1363  pFrame->jump_to(pidl, mode);
1364 
1365  return hFrame;
1366 }
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static HWND Create()
Definition: mainframe.cpp:1342
#define SW_SHOW
Definition: winuser.h:769
#define GET_WINDOW(CLASS, hwnd)
Definition: window.h:88
void jump_to(LPCTSTR path, int mode)
Definition: mainframe.cpp:1665

◆ entry_selected()

void SDIMainFrame::entry_selected ( Entry entry)
protectedvirtual

Implements BrowserCallback.

Definition at line 1645 of file mainframe.cpp.

1646 {
1647  if (_left_hwnd)
1648  _shellBrowser->select_folder(entry, false);
1649 
1651 
1652  // set size of new created shell view windows
1653  resize_children();
1654 }
void resize_children()
Definition: mainframe.cpp:1577
bool select_folder(Entry *entry, bool expand)
WindowHandle _left_hwnd
Definition: mainframe.h:154
virtual ShellFolder get_shell_folder() const
Definition: shellfs.cpp:237
void UpdateFolderView(IShellFolder *folder)
auto_ptr< ShellBrowser > _shellBrowser
Definition: shellbrowser.h:209

◆ jump_to() [1/2]

void SDIMainFrame::jump_to ( LPCTSTR  path,
int  mode 
)
protected

Definition at line 1665 of file mainframe.cpp.

Referenced by Create(), and WndProc().

1666 {/*@@todo
1667  if (_shellBrowser.get() && (_shellpath_info._open_mode&~OWM_PIDL)==(mode&~OWM_PIDL)) {
1668  _shellBrowser->jump_to(path);
1669 
1670  _shellpath_info._shell_path = path;
1671  } else */{
1674 
1676  }
1677 }
GLsizei const GLchar ** path
Definition: glext.h:7234
ShellPath _shell_path
Definition: shellbrowser.h:45
GLenum mode
Definition: glext.h:6217
void update_shell_browser()
Definition: mainframe.cpp:1605
ShellPathInfo _shellpath_info
Definition: mainframe.h:152

◆ jump_to() [2/2]

void SDIMainFrame::jump_to ( LPCITEMIDLIST  path,
int  mode 
)
protected

Definition at line 1679 of file mainframe.cpp.

1680 {
1682  ShellPath shell_path = path;
1683 
1684  _shellBrowser->jump_to(shell_path);
1685 
1686  _shellpath_info._shell_path = shell_path;
1687  } else {
1690 
1692  }
1693 }
GLsizei const GLchar ** path
Definition: glext.h:7234
_Tp * get() const _STLP_NOTHROW
Definition: _auto_ptr.h:66
ShellPath _shell_path
Definition: shellbrowser.h:45
GLenum mode
Definition: glext.h:6217
void update_shell_browser()
Definition: mainframe.cpp:1605
ShellPathInfo _shellpath_info
Definition: mainframe.h:152
view files in detail mode
Definition: mainframe.h:35
void jump_to(LPCITEMIDLIST pidl)
wrapper class for item ID lists
Definition: shellclasses.h:651
auto_ptr< ShellBrowser > _shellBrowser
Definition: shellbrowser.h:209

◆ resize_children()

void SDIMainFrame::resize_children ( )
protected

Definition at line 1577 of file mainframe.cpp.

Referenced by entry_selected(), resize_frame(), and WndProc().

1578 {
1579  HDWP hdwp = BeginDeferWindowPos(2);
1580 
1581  int cx = _clnt_rect.left;
1582 
1583  if (_left_hwnd) {
1584  cx = _split_pos + SPLIT_WIDTH/2;
1585 
1587  } else {
1588  //_split_pos = -1;
1589  cx = 0;
1590  }
1591 
1592  if (_right_hwnd)
1594 
1595  EndDeferWindowPos(hdwp);
1596 }
HDWP WINAPI BeginDeferWindowPos(_In_ int)
LONG top
Definition: windef.h:297
WindowHandle _right_hwnd
Definition: mainframe.h:155
LONG left
Definition: windef.h:296
#define SWP_NOZORDER
Definition: winuser.h:1232
LONG right
Definition: windef.h:298
#define SPLIT_WIDTH
Definition: eventvwr.c:62
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
int _split_pos
Definition: mainframe.h:161
#define SWP_NOACTIVATE
Definition: winuser.h:1227
WindowHandle _left_hwnd
Definition: mainframe.h:154
RECT _clnt_rect
Definition: mainframe.h:163
_Out_opt_ int * cx
Definition: commctrl.h:570
LONG bottom
Definition: windef.h:299

◆ resize_frame()

void SDIMainFrame::resize_frame ( int  cx,
int  cy 
)
protectedvirtual

Reimplemented from MainFrameBase.

Definition at line 1536 of file mainframe.cpp.

Referenced by update_clnt_rect(), update_shell_browser(), and WndProc().

1537 {
1538  if (cy <= 0)
1539  return; // avoid resizing children when receiving RBN_AUTOSIZE while getting minimized
1540 
1541  RECT rect = {0, 0, cx, cy};
1542 
1543  if (_hwndrebar) {
1544  int height = ClientRect(_hwndrebar).bottom;
1545  rect.top += height;
1546  rect.top += 5;
1547  } else {
1548  if (IsWindowVisible(_htoolbar)) {
1549  SendMessage(_htoolbar, WM_SIZE, 0, 0);
1550  WindowRect rt(_htoolbar);
1551  rect.top = rt.bottom;
1552  // rect.bottom -= rt.bottom;
1553  }
1554  }
1555 
1557  int parts[] = {300, 500};
1558 
1560  SendMessage(_hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
1561  ClientRect rt(_hstatusbar);
1562  rect.bottom -= rt.bottom;
1563  }
1564 
1565  if (IsWindowVisible(_hsidebar)) {
1566  WindowRect rt(_hsidebar);
1567  rect.left += rt.right-rt.left;
1568 
1569  SetWindowPos(_hsidebar, 0, -1, rect.top-1, rt.right-rt.left, rect.bottom-rect.top+1, SWP_NOACTIVATE|SWP_NOZORDER);
1570  }
1571 
1572  _clnt_rect = rect;
1573 
1574  resize_children();
1575 }
WindowHandle _hwndrebar
Definition: mainframe.h:51
LONG top
Definition: windef.h:297
void resize_children()
Definition: mainframe.cpp:1577
LONG left
Definition: windef.h:296
#define SWP_NOZORDER
Definition: winuser.h:1232
& rect
Definition: startmenu.cpp:1413
LONG_PTR LPARAM
Definition: windef.h:208
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
#define WM_SIZE
Definition: winuser.h:1593
#define SWP_NOACTIVATE
Definition: winuser.h:1227
WindowHandle _hsidebar
Definition: mainframe.h:57
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
WindowHandle _htoolbar
Definition: mainframe.h:53
RECT _clnt_rect
Definition: mainframe.h:163
#define SB_SETPARTS
Definition: commctrl.h:1924
_Out_opt_ int * cx
Definition: commctrl.h:570
#define SendMessage
Definition: winuser.h:5709
BOOL WINAPI IsWindowVisible(_In_ HWND)
LONG bottom
Definition: windef.h:299
WindowHandle _hstatusbar
Definition: mainframe.h:55
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

◆ set_url()

void SDIMainFrame::set_url ( LPCTSTR  url)
protected

Definition at line 1656 of file mainframe.cpp.

1657 {
1658  if (_url != url) {
1659  _url = url;
1661  }
1662 }
WindowHandle _haddrcombo
Definition: mainframe.h:54
String _url
Definition: mainframe.h:165
static const WCHAR url[]
Definition: encode.c:1432
#define SetWindowText
Definition: winuser.h:5723

◆ update_clnt_rect()

void SDIMainFrame::update_clnt_rect ( )
protected

Definition at line 1598 of file mainframe.cpp.

Referenced by update_shell_browser().

1599 {
1600  ClientRect rect(_hwnd);
1601 
1602  resize_frame(rect.right, rect.bottom);
1603 }
void resize_frame(int cx, int cy)
Definition: mainframe.cpp:1536
& rect
Definition: startmenu.cpp:1413

◆ update_shell_browser()

void SDIMainFrame::update_shell_browser ( )
protected

Definition at line 1605 of file mainframe.cpp.

Referenced by jump_to().

1606 {
1607  int split_pos = DEFAULT_SPLIT_POS;
1608 
1609  if (_shellBrowser.get()) {
1610  split_pos = _split_pos;
1611  delete _shellBrowser.release();
1612  }
1613 
1614  // create explorer treeview
1616  if (!_left_hwnd) {
1617  ClientRect rect(_hwnd);
1618 
1621  0, rect.top, split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top,
1622  _hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0);
1623 
1624  // display tree window as long as the shell view is not yet visible
1625  resize_frame(rect.right, rect.bottom);
1626  MoveWindow(_left_hwnd, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, TRUE);
1627  }
1628  } else {
1629  if (_left_hwnd) {
1631  _left_hwnd = 0;
1632  }
1633  }
1634 
1636  _shellpath_info, this, _cm_ifs));
1637 
1638  if (_left_hwnd)
1639  _shellBrowser->Init();
1640 
1641  // update _clnt_rect and set size of new created shell view windows
1642  update_clnt_rect();
1643 }
void resize_frame(int cx, int cy)
Definition: mainframe.cpp:1536
#define TRUE
Definition: types.h:120
#define TVS_LINESATROOT
Definition: commctrl.h:3216
#define IDC_FILETREE
Definition: resource.h:188
WindowHandle _right_hwnd
Definition: mainframe.h:155
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
& rect
Definition: startmenu.cpp:1413
#define SPLIT_WIDTH
Definition: eventvwr.c:62
void update_clnt_rect()
Definition: mainframe.cpp:1598
#define DEFAULT_SPLIT_POS
Definition: window.h:270
_Tp * release() _STLP_NOTHROW
Definition: _auto_ptr.h:53
#define TVS_HASBUTTONS
Definition: commctrl.h:3214
#define CreateWindowEx
Definition: winuser.h:5621
smooth NULL
Definition: ftsmooth.c:416
_Tp * get() const _STLP_NOTHROW
Definition: _auto_ptr.h:66
int _split_pos
Definition: mainframe.h:161
#define WC_TREEVIEW
Definition: commctrl.h:3212
WindowHandle _left_hwnd
Definition: mainframe.h:154
HINSTANCE _hInstance
Definition: globals.h:270
#define TVS_NOTOOLTIPS
Definition: commctrl.h:3221
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define WS_TABSTOP
Definition: pedump.c:634
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
ShellPathInfo _shellpath_info
Definition: mainframe.h:152
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3219
#define TVS_HASLINES
Definition: commctrl.h:3215
#define WS_VISIBLE
Definition: pedump.c:620
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
auto_ptr< ShellBrowser > _shellBrowser
Definition: shellbrowser.h:209
static IShellBrowser ShellBrowser
Definition: htmldoc.c:3702

◆ WndProc()

LRESULT SDIMainFrame::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
protectedvirtual
Todo:
read paths and window placements from registry
Todo:
content of 'path' not used any more

Reimplemented from MainFrameBase.

Definition at line 1384 of file mainframe.cpp.

1385 {
1386  switch(nmsg) {
1387  case WM_SIZE:
1389  break;
1390 
1391  case WM_PAINT: {
1392  PaintCanvas canvas(_hwnd);
1393 
1394  if (_left_hwnd) {
1395  ClientRect rt(_hwnd);
1396  rt.left = _split_pos-SPLIT_WIDTH/2;
1397  rt.right = _split_pos+SPLIT_WIDTH/2+1;
1398 
1399  if (_right_hwnd) {
1400  WindowRect right_rect(_right_hwnd);
1401  ScreenToClient(_hwnd, &right_rect);
1402  rt.top = right_rect.top;
1403  rt.bottom = right_rect.bottom;
1404  }
1405 
1406  HBRUSH lastBrush = SelectBrush(canvas, GetStockBrush(COLOR_SPLITBAR));
1407  Rectangle(canvas, rt.left, rt.top-1, rt.right, rt.bottom+1);
1408  SelectObject(canvas, lastBrush);
1409  }
1410  break;}
1411 
1412  case WM_SETCURSOR:
1413  if (_left_hwnd)
1414  if (LOWORD(lparam) == HTCLIENT) {
1415  POINT pt;
1416  GetCursorPos(&pt);
1417  ScreenToClient(_hwnd, &pt);
1418 
1419  if (pt.x>=_split_pos-SPLIT_WIDTH/2 && pt.x<_split_pos+SPLIT_WIDTH/2+1) {
1421  return TRUE;
1422  }
1423  }
1424  goto def;
1425 
1426  case WM_LBUTTONDOWN:
1427  if (_left_hwnd) {
1428  int x = GET_X_LPARAM(lparam);
1429 
1430  ClientRect rt(_hwnd);
1431 
1432  if (x>=_split_pos-SPLIT_WIDTH/2 && x<_split_pos+SPLIT_WIDTH/2+1) {
1434  SetCapture(_hwnd);
1435  }
1436  }
1437  break;
1438 
1439  case WM_LBUTTONUP:
1440  if (GetCapture() == _hwnd)
1441  ReleaseCapture();
1442  break;
1443 
1444  case WM_KEYDOWN:
1445  if (wparam == VK_ESCAPE)
1446  if (GetCapture() == _hwnd) {
1448  resize_children();
1449  _last_split = -1;
1450  ReleaseCapture();
1452  }
1453  break;
1454 
1455  case WM_MOUSEMOVE:
1456  if (GetCapture() == _hwnd) {
1457  int x = GET_X_LPARAM(lparam);
1458 
1459  ClientRect rt(_hwnd);
1460 
1461  if (x>=0 && x<rt.right) {
1462  _split_pos = x;
1463  resize_children();
1464  rt.left = x-SPLIT_WIDTH/2;
1465  rt.right = x+SPLIT_WIDTH/2+1;
1466  InvalidateRect(_hwnd, &rt, FALSE);
1468  UpdateWindow(_hwnd);
1470  }
1471  }
1472  break;
1473 
1474  case PM_OPEN_WINDOW: {
1475  CONTEXT("SDIMainFrame PM_OPEN_WINDOW");
1476 
1478  LPCTSTR path;
1479  ShellPath shell_path = DesktopFolderPath();
1480 
1481  if (lparam) {
1482  if (wparam & OWM_PIDL) {
1483  // take over PIDL from lparam
1484  shell_path.assign((LPCITEMIDLIST)lparam); // create as "rooted" window
1485  FileSysShellPath fsp(shell_path);
1486  path = fsp;
1487 
1488  if (path) {
1489  LOG(FmtString(TEXT("SDIMainFrame PM_OPEN_WINDOW: path=%s"), path));
1490  lstrcpy(buffer, path);
1491  path = buffer;
1492  }
1493  } else {
1494  // take over path from lparam
1495  path = (LPCTSTR)lparam;
1496  shell_path = path; // create as "rooted" window
1497  }
1498  } else {
1500  if (!GetCurrentDirectory(MAX_PATH, buffer))
1501  *buffer = '\0';
1502 
1503  path = buffer;
1504  shell_path = path;
1505  }
1506 
1507  if (wparam & OWM_ROOTED)
1508  _shellpath_info._root_shell_path = shell_path;
1509  else
1510  _shellpath_info._root_shell_path = DesktopFolderPath(); //SpecialFolderPath(CSIDL_DRIVES, _hwnd);
1511 
1512  jump_to(shell_path, wparam);
1513  return TRUE;} // success
1514 
1515  default: def:
1516  return super::WndProc(nmsg, wparam, lparam);
1517  }
1518 
1519  return 0;
1520 }
#define IDC_SIZEWE
Definition: winuser.h:689
void resize_frame(int cx, int cy)
Definition: mainframe.cpp:1536
struct _CONTEXT CONTEXT
#define TRUE
Definition: types.h:120
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
Retrieval of file system paths of ShellPath objects.
Definition: shellclasses.h:932
long x
Definition: polytest.cpp:48
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define pt(x, y)
Definition: drawing.c:79
GLsizei const GLchar ** path
Definition: glext.h:7234
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
BOOL WINAPI UpdateWindow(_In_ HWND)
void resize_children()
Definition: mainframe.cpp:1577
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
GLuint buffer
Definition: glext.h:5915
WindowHandle _right_hwnd
Definition: mainframe.h:155
#define VK_ESCAPE
Definition: winuser.h:2168
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
#define SPLIT_WIDTH
Definition: eventvwr.c:62
#define WM_SETCURSOR
Definition: winuser.h:1618
HWND WINAPI GetCapture(void)
Definition: message.c:2855
#define GetCurrentDirectory
Definition: winbase.h:3619
#define WM_KEYDOWN
Definition: winuser.h:1691
#define GET_X_LPARAM(lp)
Definition: precomp.h:67
ShellPath _root_shell_path
Definition: shellbrowser.h:46
int _last_split
Definition: mainframe.h:162
char TCHAR
Definition: xmlstorage.h:189
int _split_pos
Definition: mainframe.h:161
#define GetStockBrush(i)
Definition: windowsx.h:282
#define WM_SIZE
Definition: winuser.h:1593
#define PM_OPEN_WINDOW
Definition: mainframe.h:29
#define MAX_PATH
Definition: compat.h:26
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define COLOR_SPLITBAR
Definition: window.h:271
WindowHandle _left_hwnd
Definition: mainframe.h:154
#define WM_PAINT
Definition: winuser.h:1602
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
UINT WPARAM LPARAM lparam
Definition: msvc.h:92
#define LoadCursor
Definition: winuser.h:5678
#define LOG(txt)
Definition: utility.h:102
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define TEXT(s)
Definition: k32.h:26
void assign(LPCITEMIDLIST pidl, size_t size)
Definition: shellclasses.h:806
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
INT x
Definition: msvc.h:62
#define lstrcpy
Definition: winbase.h:3688
#define WM_LBUTTONUP
Definition: winuser.h:1753
ShellPathInfo _shellpath_info
Definition: mainframe.h:152
#define WM_MOUSEMOVE
Definition: winuser.h:1751
window in explore mode
Definition: mainframe.h:33
#define IDC_ARROW
Definition: winuser.h:682
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2864
#define HIWORD(l)
Definition: typedefs.h:246
#define SelectBrush(hdc, hbr)
Definition: windowsx.h:485
view files in detail mode
Definition: mainframe.h:35
#define HTCLIENT
Definition: winuser.h:2429
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
void jump_to(LPCTSTR path, int mode)
Definition: mainframe.cpp:1665
wrapper class for item ID lists
Definition: shellclasses.h:651
#define LOWORD(l)
Definition: pedump.c:82
UINT WPARAM wparam
Definition: msvc.h:92
Shell folder path of the desktop.
Definition: shellclasses.h:991

Member Data Documentation

◆ _clnt_rect

RECT SDIMainFrame::_clnt_rect
protected

Definition at line 163 of file mainframe.h.

Referenced by resize_children(), and resize_frame().

◆ _last_split

int SDIMainFrame::_last_split
protected

Definition at line 162 of file mainframe.h.

Referenced by SDIMainFrame(), and WndProc().

◆ _left_hwnd

WindowHandle SDIMainFrame::_left_hwnd
protected

Definition at line 154 of file mainframe.h.

Referenced by entry_selected(), resize_children(), update_shell_browser(), and WndProc().

◆ _right_hwnd

WindowHandle SDIMainFrame::_right_hwnd
protected

Definition at line 155 of file mainframe.h.

Referenced by resize_children(), update_shell_browser(), and WndProc().

◆ _shellpath_info

ShellPathInfo SDIMainFrame::_shellpath_info
protected

Definition at line 152 of file mainframe.h.

Referenced by jump_to(), update_shell_browser(), and WndProc().

◆ _split_pos

int SDIMainFrame::_split_pos
protected
Todo:
focus handling for TAB switching int _focus_pane; // 0: left 1: right

Definition at line 161 of file mainframe.h.

Referenced by resize_children(), SDIMainFrame(), update_shell_browser(), and WndProc().

◆ _url

String SDIMainFrame::_url
protected

Definition at line 165 of file mainframe.h.

Referenced by Command(), and set_url().


The documentation for this struct was generated from the following files: