Guidance
指路人
g.yi.org
software / RapidQ / System / Win32 / Rapid-Q++ / rqlistbox.h

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
#if !defined RQLISTBOX_H
#define RQLISTBOX_H

#include <windows.h>
#include "rqfont.h"
#include "rqcanvas.h"
#include "rqcontrol.h"
#include "rqdefs.h"

class RQListBox: public RQControl
{
private:
    char *tempItem;
    char **tempItems;
    int tempItemsCount;
    void freeTempItems();
    void saveItems();
    void loadItems();

protected:
    HWND handle;
    char *caption;
    int itemIndex, itemHeight;
    bool sorted;

    void messageHandler(HWND, UINT, WPARAM, LPARAM);
    HWND getHandle() { return handle; }
    RQControl* getParent() { return parent; }
    void recreateHandle();

public:
    RQListBox();
    ~RQListBox();

    // ListBox properties
    RQFont font;
    RQCanvas canvas;
    void  setParent(RQControl&);
    void  setItemIndex(int itemIndex);
    int   getItemIndex();
    int   getItemCount();
    void  setItem(int index, const char*);
    const char* getItem(int index);
    void  setItemHeight(int);
    int getItemHeight();
    void  setSorted(bool);
    bool  getSorted();

    // ListBox methods
    void  addItem(const char*);
    void  insertItem(const int, const char*);
    void  deleteItem(const int);
    void  clear();

    // ListBox events
    void (*onChange)(RQListBox&);
    void (*onDrawItem)(int index, int state, RECT rect, RQListBox&);
};

#endif
掌柜推荐
 
 
¥908.00 ·
 
 
¥1,380.00 ·
 
 
¥1,580.00 ·
 
 
¥890.00 ·
 
 
¥1,800.00 ·
 
 
¥294.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-08-20 12:34:43