Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

MDIShellBrowserChild Struct Reference

#include <shellbrowser.h>

Inheritance diagram for MDIShellBrowserChild:
Inheritance graph
[legend]
Collaboration diagram for MDIShellBrowserChild:
Collaboration graph
[legend]

List of all members.

Public Types

typedef ExtContextMenuHandlerT
< ShellBrowserChildT
< ChildWindow > > 
super

Public Member Functions

 MDIShellBrowserChild (HWND hwnd, const ShellChildWndInfo &info)
LRESULT Init (LPCREATESTRUCT)
virtual String jump_to_int (LPCTSTR url)

Static Public Member Functions

static MDIShellBrowserChildcreate (const ShellChildWndInfo &info)

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
void update_shell_browser ()
virtual void entry_selected (Entry *entry)

Protected Attributes

ShellChildWndInfo _create_info
ShellPathInfo _shellpath_info

Detailed Description

Definition at line 249 of file shellbrowser.h.


Member Typedef Documentation

Reimplemented from ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >.

Definition at line 255 of file shellbrowser.h.


Constructor & Destructor Documentation

MDIShellBrowserChild::MDIShellBrowserChild ( HWND  hwnd,
const ShellChildWndInfo info 
)

todo Conversion of shell path into path string -> store into URL history const String& path = GetDesktopFolder().get_name(info._shell_path, SHGDN_FORADDRESSBAR); const String& parsingpath = GetDesktopFolder().get_name(info._shell_path, SHGDN_FORPARSING);

store path into history if (info._path && *info._path) _url_history.push(info._path);

Definition at line 616 of file shellbrowser.cpp.

 :  super(hwnd, info),
    _create_info(info),
    _shellpath_info(info)   //@@ copies info -> no reference to _create_info !
{
/**todo Conversion of shell path into path string -> store into URL history
    const String& path = GetDesktopFolder().get_name(info._shell_path, SHGDN_FORADDRESSBAR);
    const String& parsingpath = GetDesktopFolder().get_name(info._shell_path, SHGDN_FORPARSING);

     // store path into history
    if (info._path && *info._path)
        _url_history.push(info._path);
*/
}

Member Function Documentation

MDIShellBrowserChild * MDIShellBrowserChild::create ( const ShellChildWndInfo info ) [static]

Definition at line 632 of file shellbrowser.cpp.

References FileChildWndInfo::_pos, CLASSNAME_CHILDWND, and WINDOW_CREATOR_INFO.

Referenced by MDIMainFrame::Command(), WndProc(), and MDIMainFrame::WndProc().

{
    ChildWindow* child = ChildWindow::create(info, info._pos.rcNormalPosition,
        WINDOW_CREATOR_INFO(MDIShellBrowserChild,ShellChildWndInfo), CLASSNAME_CHILDWND, NULL, info._pos.showCmd==SW_SHOWMAXIMIZED? WS_MAXIMIZE: 0);

    return static_cast<MDIShellBrowserChild*>(child);
}

Here is the caller graph for this function:

void MDIShellBrowserChild::entry_selected ( Entry entry ) [protected, virtual]

Implements BrowserCallback.

Definition at line 738 of file shellbrowser.cpp.

References WindowHandle::_hwnd, ChildWindow::_left_hwnd, ShellBrowserChildT< ChildWindow >::_shellBrowser, COUNTOF, Entry::get_path(), Entry::get_shell_folder(), String::printf(), ChildWindow::resize_children(), ChildWindow::set_url(), and TEXT.

{
    if (_left_hwnd)
        _shellBrowser->select_folder(entry, false);

    _shellBrowser->UpdateFolderView(entry->get_shell_folder());

     // set size of new created shell view windows
    ClientRect rt(_hwnd);
    resize_children(rt.right, rt.bottom);

     // set new URL
    TCHAR path[MAX_PATH];

    if (entry->get_path(path, COUNTOF(path))) {
        String url;

        if (path[0] == ':')
            url.printf(TEXT("shell://%s"), path);
        else
            url.printf(TEXT("file://%s"), path);

        set_url(url);
    }
}

Here is the call graph for this function:

LRESULT MDIShellBrowserChild::Init ( LPCREATESTRUCT  pcs ) [virtual]

Reimplemented from Window.

Definition at line 641 of file shellbrowser.cpp.

References CONTEXT, Window::Init(), and update_shell_browser().

{
    CONTEXT("MDIShellBrowserChild::Init()");

    if (super::Init(pcs))
        return 1;

    update_shell_browser();

    return 0;
}

Here is the call graph for this function:

String MDIShellBrowserChild::jump_to_int ( LPCTSTR  url ) [virtual]

Todo:
use fname

Implements ChildWindow.

Definition at line 717 of file shellbrowser.cpp.

References ShellBrowserChildT< ChildWindow >::_shellBrowser, _tcsnicmp, SplitFileSysURL(), and TEXT.

{
    String dir, fname;

    if (!_tcsnicmp(url, TEXT("shell://"), 8)) {
        if (_shellBrowser->jump_to_pidl(ShellPath(url+8)))
            return url;
    }

    if (SplitFileSysURL(url, dir, fname)) {

        ///@todo use fname

        if (_shellBrowser->jump_to_pidl(ShellPath(dir)))
            return FmtString(TEXT("file://%s"), (LPCTSTR)dir);
    }

    return String();
}

Here is the call graph for this function:

void MDIShellBrowserChild::update_shell_browser (  ) [protected]

Definition at line 684 of file shellbrowser.cpp.

References ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >::_cm_ifs, _create_info, ExplorerGlobals::_hInstance, WindowHandle::_hwnd, ChildWindow::_hwndFrame, ChildWindow::_left_hwnd, FileChildWndInfo::_open_mode, ChildWindow::_right_hwnd, ShellBrowserChildT< ChildWindow >::_shellBrowser, _shellpath_info, ChildWindow::_split_pos, DEFAULT_SPLIT_POS, g_Globals, IDC_FILETREE, OWM_EXPLORE, and SPLIT_WIDTH.

Referenced by Init().

{
    int split_pos = DEFAULT_SPLIT_POS;

    if (_shellBrowser.get()) {
        split_pos = _split_pos;
        delete _shellBrowser.release();
    }

     // create explorer treeview
    if (_create_info._open_mode & OWM_EXPLORE) {
        if (!_left_hwnd) {
            ClientRect rect(_hwnd);

            _left_hwnd = CreateWindowEx(0, WC_TREEVIEW, NULL,
                            WS_CHILD|WS_TABSTOP|WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS,//|TVS_NOTOOLTIPS
                            0, rect.top, split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top,
                            _hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0);
        }
    } else {
        if (_left_hwnd) {
            DestroyWindow(_left_hwnd);
            _left_hwnd = 0;
        }
    }

    _shellBrowser = auto_ptr<ShellBrowser>(new ShellBrowser(_hwnd, _hwndFrame, _left_hwnd, _right_hwnd,
                                                _shellpath_info, this, _cm_ifs));

    _shellBrowser->Init();
}

Here is the caller graph for this function:

LRESULT MDIShellBrowserChild::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
) [protected, virtual]

Todo:
refresh shell child

Reimplemented from ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >.

Definition at line 654 of file shellbrowser.cpp.

References _create_info, ShellBrowserChildT< ChildWindow >::_shellBrowser, ChildWindow::_url, CONTEXT, Window::Create(), create(), ID_REFRESH, ID_VIEW_SDI, ID_WINDOW_NEW, PM_DISPATCH_COMMAND, and ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >::WndProc().

{
    switch(nmsg) {
      case PM_DISPATCH_COMMAND: {
        switch(LOWORD(wparam)) {
          case ID_WINDOW_NEW: {CONTEXT("MDIShellBrowserChild PM_DISPATCH_COMMAND ID_WINDOW_NEW");
            MDIShellBrowserChild::create(_create_info);
            break;}

          case ID_REFRESH:
            ///@todo refresh shell child
            _shellBrowser->invalidate_cache();
            break;

          case ID_VIEW_SDI:
            MainFrameBase::Create(ExplorerCmd(_url, false));
            break;

          default:
            return super::WndProc(nmsg, wparam, lparam);
        }
        return TRUE;}

      default:
        return super::WndProc(nmsg, wparam, lparam);
    }

    return 0;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 266 of file shellbrowser.h.

Referenced by update_shell_browser(), and WndProc().

Definition at line 267 of file shellbrowser.h.

Referenced by update_shell_browser().


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

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage