⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 folderctrl.h

📁 funambol window mobile客户端源代码
💻 H
字号:
/*
 * Funambol is a mobile platform developed by Funambol, Inc. 
 * Copyright (C) 2003 - 2007 Funambol, Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by
 * the Free Software Foundation with the addition of the following permission
 * added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
 * WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE
 * WARRANTY OF NON INFRINGEMENT  OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program; if not, see http://www.gnu.org/licenses or write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301 USA.
 * 
 * You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite
 * 305, Redwood City, CA 94063, USA, or at email address info@funambol.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License
 * version 3, these Appropriate Legal Notices must retain the display of the
 * "Powered by Funambol" logo. If the display of the logo is not reasonably
 * feasible for technical reasons, the Appropriate Legal Notices must display
 * the words "Powered by Funambol".
 */

#ifndef _INCL_FOLDERCTRL
#define _INCL_FOLDERCTRL

#pragma once
#include "stdafx.h"


#include <list>
using namespace std;

#if defined(WIN32_PLATFORM_PSPC)
//  defines and functions used by Pocket PC folder view tree control
#include <aygshell.h>

//Menu Bar Height
#define MENU_HEIGHT 26

//#define SHGetMenu(hWndMB)  (HMENU)SendMessage((hWndMB), SHCMBM_GETMENU, (WPARAM)0, (LPARAM)0);
#define SHGetSubMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_GETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU);
#define SHSetSubMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_SETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU);

//Alternate definition
#define SHMenuBar_GetMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_GETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU);

typedef enum tagIMAGES { IMAGE_OPEN, IMAGE_CLOSED, IMAGE_EXE, IMAGE_TREE, IMAGE_DOCUMENT} IMAGES;

/**
 * application instance handle
 */
extern HINSTANCE g_hInstance;

/**
 * handle to the menubar window
 */
extern HWND hwndCB;

extern HIMAGELIST himl;			// handle of the image list

/**
 * inits the image list for the tree, images for folder expanded/closed
 */
BOOL InitTreeViewImageLists(HWND);

// currently does nothing
BOOL InitTreeViewItems(HWND);

/**
 * adds an item to the tree
 * @param hwndTV     - handle of the treeview to add the item to
 * @param lpszItem   - string to add to the tree
 * @param htiParent  - handle of the tree item that will be this item's parent
 * @param fDirectory - TRUE if this item is a directory
 */
HTREEITEM AddItemToTree(HWND hwndTV, LPTSTR lpszItem, HTREEITEM htiParent, BOOL fDirectory);

/**
 * populates the tree with the folders from pszDirectory folder
 * @param hwndTV          - TreeView to add the contents to
 * @param pszDirectory    - Path of the directory to list the contents for
 * @param htiParent       - TreeView item to add the contents as children of
 */
BOOL GetDirectoryContents(HWND hwndTV, LPTSTR pszDirectory, HTREEITEM htiParent);

/**
* @param hwndTV  - handle of the treeview control
* @param tvi     - item to build the path for
* @param lpszDir - string to place the path into
 */
BOOL BuildDirectory(HWND hwndTV, TV_ITEM tvi, LPTSTR lpszDir);

#define IDC_TREEVIEW	101
#define CX_BITMAP		 16
#define CY_BITMAP		 15
#define NUM_BITMAPS		  3

#endif


#if defined(WIN32_PLATFORM_WFSP)
    // Smartphone platform

    /**
     *  adds an item to the listbox containing the folders from the current folder
     */
    void AddItemToList(CListBox* , CString);

    /**
     *  populates the listbox with the subfolders of the <pszDirectory> folder
     */
    BOOL GetDirectoryContents( CListBox* list1, LPTSTR pszDirectory);

    /**
     *  takes the folders from the <path> list and constructs the path in <outString>
     * @param path : list, each element contains a folder from the path
     * @param outString: [OUT] will contain the constructed path
     * @return : always TRUE
     */
    BOOL BuildDirectory(list<CString> path, CString& outString);

    /**
     * adds the root to <list1>, not used anywhere
     */
    BOOL InitListViewItems(CListBox* list1);
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -