[Drdivx-commits] SF.net SVN: drdivx: [1043] DrDivX/trunk/drdivx2/src/wxgui
Brought to you by:
harikrishnan_v,
seabass089
From: <ro...@us...> - 2006-12-28 17:37:36
|
Revision: 1043 http://svn.sourceforge.net/drdivx/?rev=1043&view=rev Author: robux4 Date: 2006-12-28 09:37:34 -0800 (Thu, 28 Dec 2006) Log Message: ----------- adjust the column sizes when a new list is displayed rename variables according to gui_dummy Modified Paths: -------------- DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.cpp DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.h DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.pjd Modified: DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.cpp =================================================================== --- DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.cpp 2006-12-28 17:20:39 UTC (rev 1042) +++ DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.cpp 2006-12-28 17:37:34 UTC (rev 1043) @@ -88,11 +88,11 @@ Init(); Create(parent, id, pos, size, style); - pluginListCtrl->InsertColumn(0, _("Name")); - pluginListCtrl->InsertColumn(1, _("Description")); + pluginTableWidget->InsertColumn(0, _("Name")); + pluginTableWidget->InsertColumn(1, _("Description")); - pluginListCtrl->SetColumnWidth(0, wxLIST_AUTOSIZE); - pluginListCtrl->SetColumnWidth(1, wxLIST_AUTOSIZE); + pluginTableWidget->SetColumnWidth(0, wxLIST_AUTOSIZE); + pluginTableWidget->SetColumnWidth(1, wxLIST_AUTOSIZE); } /*! @@ -123,10 +123,10 @@ { ////@begin PluginListWidget member initialisation currJob = NULL; - pluginListCtrl = NULL; - addPluginButton = NULL; + pluginTableWidget = NULL; + addPluginPushButton = NULL; addPluginLabel = NULL; - removePluginButton = NULL; + removePluginPushButton = NULL; removePluginLabel = NULL; ////@end PluginListWidget member initialisation } @@ -142,22 +142,22 @@ wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); itemPanel1->SetSizer(itemBoxSizer2); - pluginListCtrl = new EnhancedListCtrl( itemPanel1, ID_LISTBOX1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT ); - itemBoxSizer2->Add(pluginListCtrl, 1, wxGROW|wxALL, 5); + pluginTableWidget = new EnhancedListCtrl( itemPanel1, ID_LISTBOX1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT ); + itemBoxSizer2->Add(pluginTableWidget, 1, wxGROW|wxALL, 5); wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer2->Add(itemBoxSizer4, 0, wxGROW, 5); - wxBitmap addPluginButtonBitmap(itemPanel1->GetBitmapResource(wxT("images/AddButton-Normal.bmp"))); - addPluginButton = new wxBitmapButton( itemPanel1, ID_ADD_PLUGIN_BUTTON, addPluginButtonBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT ); - itemBoxSizer4->Add(addPluginButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); + wxBitmap addPluginPushButtonBitmap(itemPanel1->GetBitmapResource(wxT("images/AddButton-Normal.bmp"))); + addPluginPushButton = new wxBitmapButton( itemPanel1, ID_ADD_PLUGIN_BUTTON, addPluginPushButtonBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT ); + itemBoxSizer4->Add(addPluginPushButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); addPluginLabel = new wxStaticText( itemPanel1, wxID_STATIC, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer4->Add(addPluginLabel, 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5); - wxBitmap removePluginButtonBitmap(itemPanel1->GetBitmapResource(wxT("images/Remove-Rollover.bmp"))); - removePluginButton = new wxBitmapButton( itemPanel1, ID_REMOVE_PLUGIN_BUTTON, removePluginButtonBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT ); - itemBoxSizer4->Add(removePluginButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); + wxBitmap removePluginPushButtonBitmap(itemPanel1->GetBitmapResource(wxT("images/Remove-Rollover.bmp"))); + removePluginPushButton = new wxBitmapButton( itemPanel1, ID_REMOVE_PLUGIN_BUTTON, removePluginPushButtonBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT ); + itemBoxSizer4->Add(removePluginPushButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); removePluginLabel = new wxStaticText( itemPanel1, wxID_STATIC, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer4->Add(removePluginLabel, 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5); @@ -248,7 +248,7 @@ if (currJob == NULL) return; - vector<long> rows = GetSelectedRows(pluginListCtrl); + vector<long> rows = GetSelectedRows(pluginTableWidget); for (size_t i = 0; i < rows.size(); i++) { @@ -270,58 +270,57 @@ void PluginListWidget::JobSelected(JobBatchWidgetEvent *event) { - currJob = event->GetJob(); - UpdateFromJob(currJob); + currJob = event->GetJob(); + UpdateFromJob(currJob); } void PluginListWidget::JobRemoved(JobBatchWidgetEvent *event) { - if (event->GetJob() == currJob) - { - UpdateFromJob(NULL); - } + if (event->GetJob() == currJob) + { + UpdateFromJob(NULL); + } } bool PluginListWidget::UpdateFromJob(IJob *job) { - while (pluginListCtrl->GetItemCount() > 0) - { - pluginListCtrl->DeleteItem(0); - } + while (pluginTableWidget->GetItemCount() > 0) + { + pluginTableWidget->DeleteItem(0); + } - // disable the buttons if the job can't be run - bool canConfigure = (job != NULL) && job->CanStart(); + // disable the buttons if the job can't be run + bool canConfigure = (job != NULL) && job->CanStart(); + addPluginPushButton->Enable(canConfigure); + addPluginLabel->Enable(canConfigure); + removePluginPushButton->Enable(canConfigure); + removePluginLabel->Enable(canConfigure); - addPluginButton->Enable(canConfigure); - addPluginLabel->Enable(canConfigure); - removePluginButton->Enable(canConfigure); - removePluginLabel->Enable(canConfigure); + if (job == NULL) + return false; - if (job == NULL) - return false; + uint32_t count = 0; + job->GetPluginCount(count); - uint32_t count = 0; - job->GetPluginCount(count); - for (uint32_t i = 0; i < count; i++) - { - IPlugin *plugin = NULL; + for (uint32_t i = 0; i < count; i++) + { + IPlugin *plugin = NULL; - job->GetPlugin(i, &plugin); + job->GetPlugin(i, &plugin); - if (plugin != NULL) - { - PluginInfo info; - plugin->GetInfo(&info); + if (plugin != NULL) + { + PluginInfo info; + plugin->GetInfo(&info); - pluginListCtrl->InsertItem(i, wxString(info.name, wxConvUTF8), 0); - pluginListCtrl->SetItem(i, 1, wxString(info.description, wxConvUTF8)); - } - } + pluginTableWidget->InsertItem(i, wxString(info.name, wxConvUTF8), 0); + pluginTableWidget->SetItem(i, 1, wxString(info.description, wxConvUTF8)); + } + } -#ifdef wxTODO // automatic resize - ui.pluginTableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch); -#endif + pluginTableWidget->SetColumnWidth(0, wxLIST_AUTOSIZE); + pluginTableWidget->SetColumnWidth(1, wxLIST_AUTOSIZE); - return true; + return true; } Modified: DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.h =================================================================== --- DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.h 2006-12-28 17:20:39 UTC (rev 1042) +++ DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.h 2006-12-28 17:37:34 UTC (rev 1043) @@ -118,10 +118,10 @@ virtual bool UpdateFromJob(IJob *job = NULL); ////@begin PluginListWidget member variables - EnhancedListCtrl* pluginListCtrl; - wxBitmapButton* addPluginButton; + EnhancedListCtrl* pluginTableWidget; + wxBitmapButton* addPluginPushButton; wxStaticText* addPluginLabel; - wxBitmapButton* removePluginButton; + wxBitmapButton* removePluginPushButton; wxStaticText* removePluginLabel; private: IJob * currJob; Modified: DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.pjd =================================================================== --- DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.pjd 2006-12-28 17:20:39 UTC (rev 1042) +++ DrDivX/trunk/drdivx2/src/wxgui/PluginListWidget.pjd 2006-12-28 17:37:34 UTC (rev 1043) @@ -322,7 +322,7 @@ <string name="proxy-Id name">"ID_LISTBOX1"</string> <long name="proxy-Id value">10001</long> <string name="proxy-Class">"EnhancedListCtrl"</string> - <string name="proxy-Member variable name">"pluginListCtrl"</string> + <string name="proxy-Member variable name">"pluginTableWidget"</string> <string name="proxy-Help text">""</string> <string name="proxy-Tooltip text">""</string> <string name="proxy-Background colour">""</string> @@ -418,7 +418,7 @@ <string name="proxy-Id name">"ID_ADD_PLUGIN_BUTTON"</string> <long name="proxy-Id value">10002</long> <string name="proxy-Class">"wxBitmapButton"</string> - <string name="proxy-Member variable name">"addPluginButton"</string> + <string name="proxy-Member variable name">"addPluginPushButton"</string> <string name="proxy-Bitmap">"images/AddButton-Normal.bmp"</string> <string name="proxy-Bitmap (selected)">""</string> <string name="proxy-Bitmap (focused)">""</string> @@ -533,7 +533,7 @@ <string name="proxy-Id name">"ID_REMOVE_PLUGIN_BUTTON"</string> <long name="proxy-Id value">10003</long> <string name="proxy-Class">"wxBitmapButton"</string> - <string name="proxy-Member variable name">"removePluginButton"</string> + <string name="proxy-Member variable name">"removePluginPushButton"</string> <string name="proxy-Bitmap">"images/Remove-Rollover.bmp"</string> <string name="proxy-Bitmap (selected)">""</string> <string name="proxy-Bitmap (focused)">""</string> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |