git-svn-id: svn://db.shs.com.ru/pip@178 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -258,7 +258,7 @@ void PIKbdListener::readKeyboard() {
|
|||||||
// 4 - alt+shift 3
|
// 4 - alt+shift 3
|
||||||
// 5 - ctrl 4
|
// 5 - ctrl 4
|
||||||
// 8 - ctrl+alt+shift 7
|
// 8 - ctrl+alt+shift 7
|
||||||
if (rc[0] == '\e') {
|
if (rc[0] == '\e') { // search for Alt
|
||||||
if (ret == 2) {
|
if (ret == 2) {
|
||||||
mod = 2;
|
mod = 2;
|
||||||
ke.key = PIChar::fromConsole(rc[1]).unicode16Code();
|
ke.key = PIChar::fromConsole(rc[1]).unicode16Code();
|
||||||
|
|||||||
@@ -30,30 +30,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/** \class PIScreen
|
|
||||||
* \brief Console output class
|
|
||||||
* \details
|
|
||||||
* \section PIScreen_sec0 Synopsis
|
|
||||||
* This class provides output to console with automatic alignment and update.
|
|
||||||
* It supports tabs, keyboard listening, formats and colors.
|
|
||||||
*
|
|
||||||
* \section PIScreen_sec1 Layout
|
|
||||||
* %PIScreen works with variable pointers. You should add your variables with
|
|
||||||
* functions \a addVariable() which receives label name, pointer to variable
|
|
||||||
* and optional column and format. Columns count is dynamically increased if
|
|
||||||
* new column used. E.g. if you add variable to empty tab to column 3, columns
|
|
||||||
* count will be increased to 3, but two firsts columns will be empty. Each column
|
|
||||||
* filled from top to bottom, but you can add just string with function
|
|
||||||
* \a addString() or add empty line with function \a addEmptyLine(). Layout scheme:
|
|
||||||
* \image html piconsole_layout.png
|
|
||||||
*
|
|
||||||
* \section PIScreen_sec2 Keyboard usage
|
|
||||||
* %PIScreen should to be single in application. %PIScreen aggregate PIKbdListener
|
|
||||||
* which grab keyboard and automatic switch tabs by theirs bind keys. If there is no
|
|
||||||
* tab binded to pressed key external function "slot" will be called
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
using namespace PIScreenTypes;
|
using namespace PIScreenTypes;
|
||||||
|
|
||||||
extern PIMutex __PICout_mutex__;
|
extern PIMutex __PICout_mutex__;
|
||||||
|
|||||||
23
src/console/piscreenconsole.cpp
Normal file
23
src/console/piscreenconsole.cpp
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#include "piscreenconsole.h"
|
||||||
|
|
||||||
|
using namespace PIScreenTypes;
|
||||||
|
|
||||||
|
|
||||||
|
TileVars::TileVars(const PIString &n) : PIScreenTile(n) {
|
||||||
|
alignment = Left;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TileVars::sizeHint(int &w, int &h) const {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void TileVars::drawEvent(PIScreenDrawer *d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIScreenConsole::PIScreenConsole() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
53
src/console/piscreenconsole.h
Normal file
53
src/console/piscreenconsole.h
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
#ifndef PISCREENCONSOLE_H
|
||||||
|
#define PISCREENCONSOLE_H
|
||||||
|
#include "piscreentiles.h"
|
||||||
|
|
||||||
|
class PIP_EXPORT TileVars: public PIScreenTile {
|
||||||
|
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;}
|
||||||
|
bool isEmpty() const {return (ptr == 0);}
|
||||||
|
PIString name;
|
||||||
|
PIScreenTypes::CellFormat format;
|
||||||
|
int nx;
|
||||||
|
int ny;
|
||||||
|
int type;
|
||||||
|
int offset;
|
||||||
|
int bitFrom;
|
||||||
|
int bitCount;
|
||||||
|
int size;
|
||||||
|
int id;
|
||||||
|
const void * ptr;
|
||||||
|
PIByteArray rdata;
|
||||||
|
void operator =(const Variable & src) {
|
||||||
|
name = src.name;
|
||||||
|
format = src.format;
|
||||||
|
nx = src.nx;
|
||||||
|
ny = src.ny;
|
||||||
|
type = src.type;
|
||||||
|
offset = src.offset;
|
||||||
|
bitFrom = src.bitFrom;
|
||||||
|
bitCount = src.bitCount;
|
||||||
|
size = src.size;
|
||||||
|
id = src.id;
|
||||||
|
ptr = src.ptr;
|
||||||
|
rdata = src.rdata;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
PIVector<Variable> variables;
|
||||||
|
PIScreenTypes::Alignment alignment;
|
||||||
|
void sizeHint(int & w, int & h) const;
|
||||||
|
void drawEvent(PIScreenDrawer * d);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class PIScreenConsole : public PIScreenTile
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PIScreenConsole();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // PISCREENCONSOLE_H
|
||||||
@@ -19,29 +19,6 @@
|
|||||||
|
|
||||||
#include "piscreendrawer.h"
|
#include "piscreendrawer.h"
|
||||||
|
|
||||||
/** \class PIScreenDrawer
|
|
||||||
* \brief Console output class
|
|
||||||
* \details
|
|
||||||
* \section PIScreen_sec0 Synopsis
|
|
||||||
* This class provides output to console with automatic alignment and update.
|
|
||||||
* It supports tabs, keyboard listening, formats and colors.
|
|
||||||
*
|
|
||||||
* \section PIScreen_sec1 Layout
|
|
||||||
* %PIScreen works with variable pointers. You should add your variables with
|
|
||||||
* functions \a addVariable() which receives label name, pointer to variable
|
|
||||||
* and optional column and format. Columns count is dynamically increased if
|
|
||||||
* new column used. E.g. if you add variable to empty tab to column 3, columns
|
|
||||||
* count will be increased to 3, but two firsts columns will be empty. Each column
|
|
||||||
* filled from top to bottom, but you can add just string with function
|
|
||||||
* \a addString() or add empty line with function \a addEmptyLine(). Layout scheme:
|
|
||||||
* \image html piconsole_layout.png
|
|
||||||
*
|
|
||||||
* \section PIScreen_sec2 Keyboard usage
|
|
||||||
* %PIScreen should to be single in application. %PIScreen aggregate PIKbdListener
|
|
||||||
* which grab keyboard and automatic switch tabs by theirs bind keys. If there is no
|
|
||||||
* tab binded to pressed key external function "slot" will be called
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
using namespace PIScreenTypes;
|
using namespace PIScreenTypes;
|
||||||
|
|
||||||
|
|||||||
@@ -21,30 +21,6 @@
|
|||||||
#include "piscreendrawer.h"
|
#include "piscreendrawer.h"
|
||||||
|
|
||||||
|
|
||||||
/** \class PIScreenTile
|
|
||||||
* \brief Console output class
|
|
||||||
* \details
|
|
||||||
* \section PIScreen_sec0 Synopsis
|
|
||||||
* This class provides output to console with automatic alignment and update.
|
|
||||||
* It supports tabs, keyboard listening, formats and colors.
|
|
||||||
*
|
|
||||||
* \section PIScreen_sec1 Layout
|
|
||||||
* %PIScreen works with variable pointers. You should add your variables with
|
|
||||||
* functions \a addVariable() which receives label name, pointer to variable
|
|
||||||
* and optional column and format. Columns count is dynamically increased if
|
|
||||||
* new column used. E.g. if you add variable to empty tab to column 3, columns
|
|
||||||
* count will be increased to 3, but two firsts columns will be empty. Each column
|
|
||||||
* filled from top to bottom, but you can add just string with function
|
|
||||||
* \a addString() or add empty line with function \a addEmptyLine(). Layout scheme:
|
|
||||||
* \image html piconsole_layout.png
|
|
||||||
*
|
|
||||||
* \section PIScreen_sec2 Keyboard usage
|
|
||||||
* %PIScreen should to be single in application. %PIScreen aggregate PIKbdListener
|
|
||||||
* which grab keyboard and automatic switch tabs by theirs bind keys. If there is no
|
|
||||||
* tab binded to pressed key external function "slot" will be called
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
using namespace PIScreenTypes;
|
using namespace PIScreenTypes;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,30 +20,6 @@
|
|||||||
#include "piscreentiles.h"
|
#include "piscreentiles.h"
|
||||||
#include "piscreendrawer.h"
|
#include "piscreendrawer.h"
|
||||||
|
|
||||||
/*
|
|
||||||
* \class PIScreen
|
|
||||||
* \brief Console output class
|
|
||||||
* \details
|
|
||||||
* \section PIScreen_sec0 Synopsis
|
|
||||||
* This class provides output to console with automatic alignment and update.
|
|
||||||
* It supports tabs, keyboard listening, formats and colors.
|
|
||||||
*
|
|
||||||
* \section PIScreen_sec1 Layout
|
|
||||||
* %PIScreen works with variable pointers. You should add your variables with
|
|
||||||
* functions \a addVariable() which receives label name, pointer to variable
|
|
||||||
* and optional column and format. Columns count is dynamically increased if
|
|
||||||
* new column used. E.g. if you add variable to empty tab to column 3, columns
|
|
||||||
* count will be increased to 3, but two firsts columns will be empty. Each column
|
|
||||||
* filled from top to bottom, but you can add just string with function
|
|
||||||
* \a addString() or add empty line with function \a addEmptyLine(). Layout scheme:
|
|
||||||
* \image html piconsole_layout.png
|
|
||||||
*
|
|
||||||
* \section PIScreen_sec2 Keyboard usage
|
|
||||||
* %PIScreen should to be single in application. %PIScreen aggregate PIKbdListener
|
|
||||||
* which grab keyboard and automatic switch tabs by theirs bind keys. If there is no
|
|
||||||
* tab binded to pressed key external function "slot" will be called
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
using namespace PIScreenTypes;
|
using namespace PIScreenTypes;
|
||||||
|
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PIP_EXPORT TileList: public PIScreenTile {
|
class PIP_EXPORT TileList: public PIScreenTile {
|
||||||
public:
|
public:
|
||||||
TileList(const PIString & n = PIString());
|
TileList(const PIString & n = PIString());
|
||||||
@@ -68,8 +66,6 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PIP_EXPORT TileButton: public PIScreenTile {
|
class PIP_EXPORT TileButton: public PIScreenTile {
|
||||||
public:
|
public:
|
||||||
TileButton(const PIString & n = PIString());
|
TileButton(const PIString & n = PIString());
|
||||||
@@ -104,8 +100,6 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PIP_EXPORT TileCheck: public PIScreenTile {
|
class PIP_EXPORT TileCheck: public PIScreenTile {
|
||||||
public:
|
public:
|
||||||
TileCheck(const PIString & n = PIString());
|
TileCheck(const PIString & n = PIString());
|
||||||
@@ -122,8 +116,6 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PIP_EXPORT TileProgress: public PIScreenTile {
|
class PIP_EXPORT TileProgress: public PIScreenTile {
|
||||||
public:
|
public:
|
||||||
TileProgress(const PIString & n = PIString());
|
TileProgress(const PIString & n = PIString());
|
||||||
@@ -138,8 +130,6 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PIP_EXPORT TilePICout: public TileList {
|
class PIP_EXPORT TilePICout: public TileList {
|
||||||
public:
|
public:
|
||||||
TilePICout(const PIString & n = PIString());
|
TilePICout(const PIString & n = PIString());
|
||||||
@@ -151,8 +141,6 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PIP_EXPORT TileInput: public PIScreenTile {
|
class PIP_EXPORT TileInput: public PIScreenTile {
|
||||||
public:
|
public:
|
||||||
TileInput(const PIString & n = PIString());
|
TileInput(const PIString & n = PIString());
|
||||||
|
|||||||
Reference in New Issue
Block a user