git-svn-id: svn://db.shs.com.ru/pip@179 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#ifndef PISCREENCONSOLE_H
|
||||
#define PISCREENCONSOLE_H
|
||||
|
||||
#include "piscreentiles.h"
|
||||
|
||||
class PIP_EXPORT TileVars: public PIScreenTile {
|
||||
@@ -7,7 +8,7 @@ public:
|
||||
TileVars(const PIString & n = PIString());
|
||||
protected:
|
||||
struct Variable {
|
||||
Variable() {nx = ny = type = offset = bitFrom = bitCount = size = 0; format = PIScreenTypes::CellFormat(); ptr = 0; id = 1;}
|
||||
Variable() {nx = ny = type = offset = bitFrom = bitCount = size = 0; format = PIScreenTypes::CellFormat(); ptr = 0;}
|
||||
bool isEmpty() const {return (ptr == 0);}
|
||||
PIString name;
|
||||
PIScreenTypes::CellFormat format;
|
||||
@@ -18,10 +19,8 @@ protected:
|
||||
int bitFrom;
|
||||
int bitCount;
|
||||
int size;
|
||||
int id;
|
||||
const void * ptr;
|
||||
PIByteArray rdata;
|
||||
void operator =(const Variable & src) {
|
||||
/*void operator =(const Variable & src) {
|
||||
name = src.name;
|
||||
format = src.format;
|
||||
nx = src.nx;
|
||||
@@ -31,10 +30,8 @@ protected:
|
||||
bitFrom = src.bitFrom;
|
||||
bitCount = src.bitCount;
|
||||
size = src.size;
|
||||
id = src.id;
|
||||
ptr = src.ptr;
|
||||
rdata = src.rdata;
|
||||
}
|
||||
}*/
|
||||
};
|
||||
PIVector<Variable> variables;
|
||||
PIScreenTypes::Alignment alignment;
|
||||
|
||||
@@ -161,4 +161,32 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
class PIP_EXPORT TileTabs: public PIScreenTile {
|
||||
public:
|
||||
TileTabs(const PIString & n = PIString());
|
||||
enum EventType {
|
||||
TabChanged
|
||||
};
|
||||
struct Tab {
|
||||
Tab(const PIString & l = PIString(), int k = 0, PIScreenTile * t = 0) {
|
||||
label = l;
|
||||
key = k;
|
||||
tile = t;
|
||||
}
|
||||
PIString label;
|
||||
int key;
|
||||
PIScreenTile * tile;
|
||||
};
|
||||
PIScreenTypes::CellFormat format_tab;
|
||||
PIScreenTypes::CellFormat format_tab_selected;
|
||||
PIDeque<Tab> tabs;
|
||||
protected:
|
||||
void sizeHint(int & w, int & h) const;
|
||||
void drawEvent(PIScreenDrawer * d);
|
||||
bool keyEvent(PIKbdListener::KeyEvent key);
|
||||
void selectTab(int index);
|
||||
int cur;
|
||||
};
|
||||
|
||||
|
||||
#endif // PISCREENTILES_H
|
||||
|
||||
@@ -69,7 +69,15 @@ namespace PIScreenTypes {
|
||||
Horizontal /** Horizontal */ ,
|
||||
Vertical /** Vertical */
|
||||
};
|
||||
|
||||
|
||||
//! Position
|
||||
enum Position {
|
||||
//Left /** Left */ ,
|
||||
//Right /** Right */ ,
|
||||
//Top /** Top */ ,
|
||||
//Bottom /** Bottom */
|
||||
};
|
||||
|
||||
//! Focus flags
|
||||
enum FocusFlag {
|
||||
CanHasFocus /** Tile can has focus */ = 0x1,
|
||||
|
||||
@@ -214,6 +214,13 @@ bool PIDir::make(bool withParents) {
|
||||
}
|
||||
|
||||
|
||||
#ifdef WINDOWS
|
||||
int sort_compare(const PIFile::FileInfo * v0, const PIFile::FileInfo * v1) {
|
||||
return strcoll(v0->path.data(), v1->path.data());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
PIVector<PIFile::FileInfo> PIDir::entries() {
|
||||
PIVector<PIFile::FileInfo> l;
|
||||
if (!isExists()) return l;
|
||||
@@ -251,6 +258,7 @@ PIVector<PIFile::FileInfo> PIDir::entries() {
|
||||
memset(&fd, 0, sizeof(fd));
|
||||
} while (FindNextFile(hf, &fd) != 0);
|
||||
FindClose(hf);
|
||||
l.sort(sort_compare);
|
||||
if (!hdd) {
|
||||
PIFile::FileInfo fi;
|
||||
fi.path = "..";
|
||||
@@ -258,6 +266,7 @@ PIVector<PIFile::FileInfo> PIDir::entries() {
|
||||
l.push_front(fi);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
dirent ** list;
|
||||
int cnt = scandir(
|
||||
|
||||
Reference in New Issue
Block a user