4238f31e6e
Files correlati : ba0.exe Ricompilazione Demo : [ ] Commento : Migliorata gestione sfondi git-svn-id: svn://10.65.10.50/trunk@20562 c028cbd2-c16b-5b4b-a496-9718f37d4682
133 lines
3.2 KiB
C++
Executable File
133 lines
3.2 KiB
C++
Executable File
#ifndef __BA0102_H
|
|
#define __BA0102_H
|
|
|
|
#ifndef __AUTOMASK_H
|
|
#include <automask.h>
|
|
#endif
|
|
|
|
#ifndef __TREECTRL_H
|
|
#include <treectrl.h>
|
|
#endif
|
|
|
|
#ifndef __TREE_H
|
|
#include <tree.h>
|
|
#endif
|
|
|
|
#ifndef __BA0101_H
|
|
#include "ba0101.h"
|
|
#endif
|
|
|
|
class TMenu_tree : public TBidirectional_tree
|
|
{
|
|
TMenu* _menu;
|
|
const TSubmenu* _submenu;
|
|
int _menuitem;
|
|
|
|
TString _root_id, _curr_id;
|
|
|
|
protected: // TTree
|
|
virtual void node2id(const TObject* node, TString& id) const;
|
|
|
|
public: // TTree
|
|
virtual bool goto_root();
|
|
virtual bool goto_firstson();
|
|
virtual bool goto_rbrother();
|
|
virtual bool goto_node(const TString &id);
|
|
virtual bool has_son() const;
|
|
virtual bool has_rbrother() const;
|
|
virtual TObject* curr_node() const;
|
|
|
|
virtual bool has_root() const;
|
|
virtual bool has_father() const;
|
|
virtual bool has_lbrother() const;
|
|
virtual bool goto_father();
|
|
virtual bool goto_lbrother();
|
|
|
|
virtual void curr_id(TString& id) const { id = _curr_id; }
|
|
virtual bool get_description(TString& desc) const;
|
|
virtual TImage* image(bool selected) const;
|
|
virtual bool enabled() const;
|
|
|
|
public:
|
|
const TSubmenu& curr_submenu() const;
|
|
const TMenuitem& curr_item() const;
|
|
|
|
bool find_leaf(const TString& str);
|
|
bool find_string(const TString& str);
|
|
long find_node(const TString& id);
|
|
void change_root(const char* id);
|
|
|
|
TMenu_tree(TMenu& menu);
|
|
virtual ~TMenu_tree() { }
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////
|
|
// TSpidey_mask Intended for internal use only :-)
|
|
///////////////////////////////////////////////////////////
|
|
|
|
class TSpidey_mask : public TAutomask
|
|
{
|
|
protected: // TMask
|
|
virtual void on_firm_change();
|
|
virtual bool stop_run(KEY k);
|
|
virtual bool on_key(KEY k);
|
|
|
|
protected:
|
|
WINDOW dlg2win(short id) const;
|
|
|
|
public:
|
|
TSpidey_mask();
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////
|
|
// TMenulist_field
|
|
///////////////////////////////////////////////////////////
|
|
|
|
class TMenulist_field : public TWindowed_field
|
|
{
|
|
protected: // TWindowed_field
|
|
virtual TField_window* create_window(int x, int y, int dx, int dy, WINDOW parent);
|
|
|
|
public:
|
|
void set_menu(TMenu_tree& mt);
|
|
void create(short dlg, int x, int y, int dx, int dy, WINDOW parent);
|
|
void curr_item(TToken_string& id) const;
|
|
|
|
TMenulist_field(TMask* m) : TWindowed_field(m) { }
|
|
virtual ~TMenulist_field() { }
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////
|
|
// TExplorer_mask
|
|
///////////////////////////////////////////////////////////
|
|
|
|
class TExplorer_mask : public TSpidey_mask
|
|
{
|
|
TMenu_tree _tree;
|
|
TString _last_search_string;
|
|
|
|
protected: // TMask
|
|
virtual void update();
|
|
virtual long handler(WINDOW win, EVENT* ep);
|
|
virtual bool on_key(KEY k);
|
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
|
|
|
protected:
|
|
virtual void select_tree_current();
|
|
enum { DLG_TREE = 101, DLG_LIST,
|
|
DLG_SHRINK = 201, DLG_PREF, DLG_ADDPREF };
|
|
|
|
public:
|
|
TExplorer_mask(TMenu& menu);
|
|
};
|
|
|
|
// Utilities
|
|
void synchronize_tree_field(TTree_field& tf);
|
|
bool can_be_transparent(const TImage& i);
|
|
void draw_spider(WINDOW win, int mode, const PNT& mouse);
|
|
void enable_options_menu(bool on);
|
|
const TString& get_logo();
|
|
int fast_hypot(int x, int y);
|
|
|
|
#endif
|