updated table

This commit is contained in:
Peter Schojer 2008-10-06 15:12:09 +00:00
parent 74a120159a
commit c8f5d2ca64
12 changed files with 103 additions and 70 deletions

View File

@ -2,6 +2,8 @@ Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Server_VS90", "Server\Server_vs90.vcproj", "{B0FFA5DF-1420-460F-8E87-E4DEBE801A05}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Picross_VS90", "Picross\Picross_VS90.vcproj", "{0D0ED3CF-2841-412A-A9AC-F07F9E61341C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
debug_shared|Win32 = debug_shared|Win32
@ -18,6 +20,14 @@ Global
{B0FFA5DF-1420-460F-8E87-E4DEBE801A05}.release_shared|Win32.Build.0 = release_shared|Win32
{B0FFA5DF-1420-460F-8E87-E4DEBE801A05}.release_static|Win32.ActiveCfg = release_static|Win32
{B0FFA5DF-1420-460F-8E87-E4DEBE801A05}.release_static|Win32.Build.0 = release_static|Win32
{0D0ED3CF-2841-412A-A9AC-F07F9E61341C}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
{0D0ED3CF-2841-412A-A9AC-F07F9E61341C}.debug_shared|Win32.Build.0 = debug_shared|Win32
{0D0ED3CF-2841-412A-A9AC-F07F9E61341C}.debug_static|Win32.ActiveCfg = debug_shared|Win32
{0D0ED3CF-2841-412A-A9AC-F07F9E61341C}.debug_static|Win32.Build.0 = debug_shared|Win32
{0D0ED3CF-2841-412A-A9AC-F07F9E61341C}.release_shared|Win32.ActiveCfg = release_shared|Win32
{0D0ED3CF-2841-412A-A9AC-F07F9E61341C}.release_shared|Win32.Build.0 = release_shared|Win32
{0D0ED3CF-2841-412A-A9AC-F07F9E61341C}.release_static|Win32.ActiveCfg = release_shared|Win32
{0D0ED3CF-2841-412A-A9AC-F07F9E61341C}.release_static|Win32.Build.0 = release_shared|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -361,6 +361,10 @@ void TableRenderer::renderProperties(const Table* pTable, const RenderContext& c
if ((*it) && (*it)->getCell())
editable |= (*it)->isEditable();
}
if (!pTable->showBorder())
ostr << ",border:false, bodyBorder:false";
if (pTable->hideHeaders())
ostr << ",hideHeaders:true";
ostr << ",listeners:{";
bool written = false;
if (editable)
@ -572,8 +576,11 @@ void TableRenderer::renderColumn(const Table* pTable, const TableColumn& tc, int
// {header: "Last updated", width: 135, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
ostr << "{";
std::string hdr(Utility::safe(tc.getHeader()));
ostr << "header:'" << hdr << "',dataIndex:'" << idx << "'";
ostr << "dataIndex:'" << idx << "'";
if (!tc.resizable())
ostr << ",resizable:false";
if (!hdr.empty())
ostr << ",header:'" << hdr << "'";
if (tc.getWidth() > 0)
ostr << ",width:" << tc.getWidth();

View File

@ -103,10 +103,6 @@ public:
bool collapsed() const;
/// Returns how the Frame should be rendered initially
void showBorder(bool show);
bool showBorder() const;
protected:
Frame(const std::type_info& type);
@ -129,7 +125,6 @@ private:
std::string _title;
bool _collapsible;
bool _collapsed;
bool _showBorder;
};
@ -191,18 +186,6 @@ inline bool Frame::collapsed() const
}
inline void Frame::showBorder(bool show)
{
_showBorder = show;
}
inline bool Frame::showBorder() const
{
return _showBorder;
}
} } // namespace Poco::WebWidgets

View File

@ -115,10 +115,6 @@ public:
bool enabled() const;
void showBorder(bool show);
bool showBorder() const;
protected:
~Panel();
/// Destroys the Panel.
@ -130,7 +126,6 @@ private:
bool _showCloseIcon;
bool _showHeader;
bool _enabled;
bool _showBorder;
};
@ -216,18 +211,6 @@ inline bool Panel::enabled() const
}
inline void Panel::showBorder(bool show)
{
_showBorder = show;
}
inline bool Panel::showBorder() const
{
return _showBorder;
}
} } // namespace Poco::WebWidgets

View File

@ -217,6 +217,11 @@ public:
bool serializeJSON(std::ostream& out, const std::string& name);
SortedTableModel::Ptr getSortedModel(std::size_t col, bool sortAscending) const;
void hideHeaders(bool val);
// hides the top headers
bool hideHeaders() const;
protected:
Table(const std::string& name, const std::type_info& type, const TableColumns& tc, TableModel::Ptr pModel);
@ -238,6 +243,7 @@ private:
SelectionModel _sm;
bool _dragAndDrop;
bool _autoEdit;
bool _hideHeaders;
int _maxRowsPerPage;
};
@ -338,6 +344,18 @@ inline bool Table::autoEdit() const
}
inline void Table::hideHeaders(bool val)
{
_hideHeaders = val;
}
inline bool Table::hideHeaders() const
{
return _hideHeaders;
}
} } // namespace Poco::WebWidgets

View File

@ -109,6 +109,12 @@ public:
bool isHidden() const;
/// Returns the hidden status of the TableColumn
void resizable(bool val);
/// Sets if th ecolumn is resizable
bool resizable() const;
/// Returns if the column is resizable
protected:
virtual ~TableColumn();
/// Destroys the TableColumn.
@ -117,6 +123,7 @@ private:
Cell::Ptr _pCell;
bool _sortable;
bool _hidden;
bool _resizable;
std::string _header;
std::string _customRenderer;
};
@ -215,7 +222,19 @@ inline bool TableColumn::isHidden() const
{
return _hidden;
}
inline void TableColumn::resizable(bool val)
{
_resizable = val;
}
inline bool TableColumn::resizable() const
{
return _resizable;
}
} } // namespace Poco::WebWidgets

View File

@ -170,7 +170,13 @@ public:
/// Returns css class
bool hasClass() const;
/// Checks if a css value is set
/// Checks if a css value is set
void showBorder(bool show);
/// Show the border around the view
bool showBorder() const;
/// Returns if view border is shown
protected:
View(const std::string& name, const std::type_info& type);
@ -203,6 +209,7 @@ private:
std::string _name;
View* _pParent;
bool _visible;
bool _showBorder;
Poco::UInt32 _width;
Poco::UInt32 _height;
Pos _pos;
@ -325,6 +332,17 @@ inline bool View::hasClass() const
}
inline void View::showBorder(bool show)
{
_showBorder = show;
}
inline bool View::showBorder() const
{
return _showBorder;
}
} } // namespace Poco::WebWidgets

View File

@ -46,8 +46,7 @@ Frame::Frame():
_pChild(),
_title(),
_collapsible(false),
_collapsed(false),
_showBorder(true)
_collapsed(false)
{
}
@ -57,8 +56,7 @@ Frame::Frame(const std::string& name):
_pChild(),
_title(),
_collapsible(false),
_collapsed(false),
_showBorder(true)
_collapsed(false)
{
}
@ -68,8 +66,7 @@ Frame::Frame(const std::string& name, const std::string& title):
_pChild(),
_title(title),
_collapsible(false),
_collapsed(false),
_showBorder(true)
_collapsed(false)
{
}
@ -79,8 +76,7 @@ Frame::Frame(View::Ptr pChild):
_pChild(),
_title(),
_collapsible(false),
_collapsed(false),
_showBorder(true)
_collapsed(false)
{
setChild(pChild);
}
@ -91,8 +87,7 @@ Frame::Frame(const std::string& name, View::Ptr pChild):
_pChild(),
_title(),
_collapsible(false),
_collapsed(false),
_showBorder(true)
_collapsed(false)
{
setChild(pChild);
}
@ -103,8 +98,7 @@ Frame::Frame(const std::string& name, const std::string& title, View::Ptr pChild
_pChild(),
_title(title),
_collapsible(false),
_collapsed(false),
_showBorder(true)
_collapsed(false)
{
setChild(pChild);
}
@ -115,8 +109,7 @@ Frame::Frame(const std::type_info& type):
_pChild(),
_title(),
_collapsible(false),
_collapsed(false),
_showBorder(true)
_collapsed(false)
{
}
@ -126,8 +119,7 @@ Frame::Frame(const std::string& name, const std::type_info& type):
_pChild(),
_title(),
_collapsible(false),
_collapsed(false),
_showBorder(true)
_collapsed(false)
{
}
@ -137,8 +129,7 @@ Frame::Frame(View::Ptr pChild, const std::type_info& type):
_pChild(),
_title(),
_collapsible(false),
_collapsed(false),
_showBorder(true)
_collapsed(false)
{
setChild(pChild);
}
@ -149,8 +140,7 @@ Frame::Frame(const std::string& name, View::Ptr pChild, const std::type_info& ty
_pChild(),
_title(),
_collapsible(false),
_collapsed(false),
_showBorder(true)
_collapsed(false)
{
setChild(pChild);
}

View File

@ -48,8 +48,7 @@ Panel::Panel():
_modal(false),
_showCloseIcon(true),
_showHeader(true),
_enabled(true),
_showBorder(true)
_enabled(true)
{
}
@ -61,8 +60,7 @@ Panel::Panel(const std::string& name):
_modal(false),
_showCloseIcon(true),
_showHeader(true),
_enabled(true),
_showBorder(true)
_enabled(true)
{
}
@ -74,8 +72,7 @@ Panel::Panel(const std::string& name, const std::string& title):
_modal(false),
_showCloseIcon(true),
_showHeader(true),
_enabled(true),
_showBorder(true)
_enabled(true)
{
}
@ -87,8 +84,7 @@ Panel::Panel(View::Ptr pChild):
_modal(false),
_showCloseIcon(true),
_showHeader(true),
_enabled(true),
_showBorder(true)
_enabled(true)
{
setChild(pChild);
}
@ -101,8 +97,7 @@ Panel::Panel(const std::string& name, View::Ptr pChild):
_modal(false),
_showCloseIcon(true),
_showHeader(true),
_enabled(true),
_showBorder(true)
_enabled(true)
{
setChild(pChild);
}
@ -115,8 +110,7 @@ Panel::Panel(const std::string& name, const std::string& title, View::Ptr pChild
_modal(false),
_showCloseIcon(true),
_showHeader(true),
_enabled(true),
_showBorder(true)
_enabled(true)
{
setChild(pChild);
}

View File

@ -73,6 +73,7 @@ Table::Table(const TableColumns& tc, TableModel::Ptr pModel):
_sm(SM_CELL),
_dragAndDrop(false),
_autoEdit(false),
_hideHeaders(false),
_maxRowsPerPage(0)
{
checkValidConfig();
@ -85,6 +86,8 @@ Table::Table(const std::string& name, const TableColumns& tc, TableModel::Ptr pM
_columns(tc),
_sm(SM_CELL),
_dragAndDrop(false),
_autoEdit(false),
_hideHeaders(false),
_maxRowsPerPage(0)
{
checkValidConfig();
@ -97,6 +100,8 @@ Table::Table(const std::string& name, const std::type_info& type, const TableCol
_columns(tc),
_sm(SM_CELL),
_dragAndDrop(false),
_autoEdit(false),
_hideHeaders(false),
_maxRowsPerPage(0)
{
checkValidConfig();
@ -109,6 +114,8 @@ Table::Table(const std::type_info& type, const TableColumns& tc, TableModel::Ptr
_columns(tc),
_sm(SM_CELL),
_dragAndDrop(false),
_autoEdit(false),
_hideHeaders(false),
_maxRowsPerPage(0)
{
checkValidConfig();

View File

@ -46,6 +46,7 @@ TableColumn::TableColumn(Cell::Ptr pCellFormat):
_pCell(pCellFormat),
_sortable(false),
_hidden(false),
_resizable(true),
_header()
{
if (_pCell)
@ -58,6 +59,7 @@ TableColumn::TableColumn(Cell::Ptr pCellFormat, const std::string& name, int wid
_pCell(pCellFormat),
_sortable(sortable),
_hidden(false),
_resizable(true),
_header(name)
{
setWidth(width);

View File

@ -46,6 +46,7 @@ View::View(const std::string& name, const std::type_info& type):
_name(name),
_pParent(0),
_visible(true),
_showBorder(true),
_width(0),
_height(0)
{
@ -57,6 +58,7 @@ View::View(const std::type_info& type):
_name(),
_pParent(0),
_visible(true),
_showBorder(true),
_width(0),
_height(0)
{