Permalink
Browse files

Added workaround for proper behavior of autosized wxDataViewCtrl columns

  • Loading branch information...
Usaga committed Dec 13, 2015
1 parent 38afc99 commit 0cc16eabbde3aa079e3977d89b94dccb261f2194
Showing with 16 additions and 4 deletions.
  1. +6 −0 po/ru.po
  2. +7 −1 src/gui/basedataviewctrl.h
  3. +3 −3 src/gui/dataviewctrlheadermenu.cpp
View
@@ -1237,6 +1237,12 @@ msgstr "Требуемый уровень:"
msgid "All"
msgstr "Все"
msgid "Hide this column"
msgstr "Спрятать эту колонку"
msgid "Show all columns"
msgstr "Показать все колонки"
#: src/gui/battlelist/battlelistfilter.cpp:177
msgid "Description:"
msgstr "Описание:"
@@ -25,7 +25,7 @@ class BaseDataViewCtrl : public wxDataViewCtrl
void Resort();
bool AddItem(const DataType&, bool resortIsNeeded = true);
bool AddItem(const DataType&, bool resortIsNeeded = true);
bool RemoveItem(const DataType&);
bool RefreshItem(const DataType&);
bool ContainsItem(const DataType&);
@@ -167,6 +167,12 @@ inline void BaseDataViewCtrl<DataType>::LoadColumnProperties()
const int colWidth = sett().GetColumnWidth(m_DataViewName, columnIndex);
const bool isHidden = sett().GetColumnVisibility(m_DataViewName, columnIndex);
wxDataViewColumn* column = GetColumn(columnIndex);
//This weird code prevents columns in wxDataViewCtrl under Linux to loose ability to resize
//https://groups.google.com/forum/#!searchin/wx-users/wxDataViewCtrl/wx-users/8khN3gsYWcg/_hOa30I6dqoJ
//Hope this will be fixed someday...
column->SetResizeable(true);
if (colWidth >= (wxDVC_DEFAULT_MINWIDTH - 5)) {
column->SetWidth(colWidth);
}
@@ -1,14 +1,14 @@
/*
* dataviewctrlheadermenu.cpp
*
* Created on: 22 èþëÿ 2015 ã.
* Author: Ðóñëàí
* Created on: 22 ���� 2015 .
* Author: ������
*/
#include <wx/dataview.h>
#include "dataviewvtrlheadermenu.h"
DataViewCtrlHeaderMenu::DataViewCtrlHeaderMenu(wxDataViewCtrl* parent, int column) : wxMenu(_("Header Managing")){
DataViewCtrlHeaderMenu::DataViewCtrlHeaderMenu(wxDataViewCtrl* parent, int column) : wxMenu(){
parentDataView = parent;
columnIndex = column;

0 comments on commit 0cc16ea

Please sign in to comment.