28 #include "wx/msw/wrapwin.h"
42 bool ProjectListBox::Create(wxWindow* parent, wxWindowID
id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
44 if (! wxListCtrl::Create(parent,
id, pos, size, wxLC_REPORT | style) )
58 this->InsertColumn(0,_(
"ID"));
59 this->InsertColumn(1,_(
"Project"));
60 this->InsertColumn(2,_(
"Output prefix"));
61 this->InsertColumn(3,_(
"Status"));
62 this->InsertColumn(4,_(
"Last modified"));
63 this->InsertColumn(5,_(
"Output format"));
64 this->InsertColumn(6,_(
"Projection"));
65 this->InsertColumn(7,_(
"Size"));
66 this->InsertColumn(8, _(
"User defined sequence"));
69 for(
int i=0; i < GetColumnCount() ; i++ )
71 int width = wxConfigBase::Get()->Read(wxString::Format(
"/BatchList/ColumnWidth%d",
columns[i] ), -1);
74 SetColumnWidth(i, width);
101 this->InsertItem(this->GetItemCount(),project->
path);
105 this->InsertItem(this->GetItemCount(),_T(
""));
106 this->SetItem(this->GetItemCount()-1,i,project->
path);
111 this->InsertItem(this->GetItemCount(),_T(
""));
119 for(
unsigned int i=1; i<
columns.GetCount(); i++)
126 this->InsertItem(this->GetItemCount(),_T(
""));
134 if(colIndex!=wxNOT_FOUND)
144 if (colIndex != wxNOT_FOUND)
153 SetItemState(index, 0, wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED);
168 while(index<this->GetItemCount())
170 if(
GetText(index,0).Cmp(wxString::Format(_(
"%d"),
id))==0)
182 for(
int i=0; i<this->GetItemCount(); i++)
195 if(!
GetText(index,0).ToLong(&
id))
205 for (
int i = 0; i<GetItemCount(); i++)
207 if (GetItemState(i, wxLIST_STATE_SELECTED) & wxLIST_STATE_SELECTED)
219 item.SetColumn(column);
220 item.SetMask(wxLIST_MASK_TEXT);
222 return item.GetText();
227 for(
unsigned int i=0; i<
columns.GetCount(); i++)
235 if(index>=0 && index<this->GetItemCount())
237 SetItemState(index,wxLIST_STATE_SELECTED,wxLIST_STATE_SELECTED);
243 for(
int i=0; i< this->GetColumnCount(); i++)
247 this->SetItem(index,i,_(
"File missing"));
251 this->SetItem(index,i,_T(
""));
259 for(
int i=0; i<GetColumnCount(); i++)
262 SetItem(index,i,
GetText(index+1,i));
263 SetItem(index+1,i,temp);
271 for(
int i=0; i< this->GetColumnCount(); i++)
276 if(newStatus.Cmp(
GetText(index,i))!=0)
279 this->SetItem(index,i,newStatus);
294 return wxString::Format(_T(
"%ld"),project->
id);
296 return project->
path;
301 wxFileName prefix(project->
prefix);
302 wxFileName projectFile(project->
path);
303 prefix.MakeRelativeTo(projectFile.GetPath());
304 return prefix.GetFullPath();
308 return _(
"Assistant");
316 if (project->
modDate.IsValid())
318 return project->
modDate.Format();
321 return wxEmptyString;
329 return wxEmptyString;
333 pano_projection_features proj;
336 wxString str2(proj.name, wxConvLocal);
337 return wxGetTranslation(str2);
344 return wxEmptyString;
353 return wxEmptyString;
359 return wxEmptyString;
391 int col =
event.GetColumn();
392 wxConfigBase::Get()->Write(wxString::Format(
"/BatchList/ColumnWidth%d",
columns[col]), GetColumnWidth(col));
399 wxPoint point = e.GetPosition();
401 if ((point.x == -1) && (point.y == -1))
403 wxSize size = GetSize();
404 point.x = size.x / 2;
405 point.y = size.y / 2;
409 point = ScreenToClient(point);
411 if (selected.size() == 1)
419 PopupMenu(&menu, point.x, point.y);
423 if (selected.size() > 1)
428 bool isSameTarget =
true;
429 for (
const auto& i : selected)
433 isSameTarget =
false;
443 PopupMenu(&menu, point.x, point.y);
450 switch (e.GetKeyCode())
453 case WXK_NUMPAD_DELETE:
455 wxCommandEvent ev(wxEVT_TOOL, XRCID(
"tool_remove"));
456 GetParent()->GetEventHandler()->AddPendingEvent(ev);
460 case WXK_NUMPAD_INSERT:
462 wxCommandEvent ev(wxEVT_MENU, XRCID(
"menu_add"));
463 GetParent()->GetEventHandler()->AddPendingEvent(ev);
468 wxCommandEvent ev(wxEVT_TOOL, XRCID(
"tool_cancel"));
469 GetParent()->GetEventHandler()->AddPendingEvent(ev);
478 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"button_prefix"));
479 GetParent()->GetEventHandler()->AddPendingEvent(ev);
484 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"button_reset"));
485 GetParent()->GetEventHandler()->AddPendingEvent(ev);
490 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"button_edit"));
491 GetParent()->GetEventHandler()->AddPendingEvent(ev);
496 wxCommandEvent ev(wxEVT_COMMAND_TOOL_CLICKED, XRCID(
"tool_remove"));
497 GetParent()->GetEventHandler()->AddPendingEvent(ev);
502 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"button_user_defined"));
503 GetParent()->GetEventHandler()->AddPendingEvent(ev);
513 _T(
"TIFF_multilayer"),
514 _T(
"TIFF_multilayer_mask"),
528 _T(
"FILEFORMAT_NULL")
539 _T(
"HDRMERGE_AVERAGE"),
540 _T(
"HDRMERGE_DEGHOST")
546 _T(
"PTBLENDER_BLEND"),
548 _T(
"SMARTBLEND_BLEND"),
555 : wxListCtrlXmlHandler()
564 cp->Create(m_parentAsWindow,
566 GetPosition(), GetSize(),
577 return IsOfClass(node,
"ProjectListBox");
void OnResetProject(wxCommandEvent &e)
PanoramaOptions::ProjectionFormat getProjection() const
int GetProjectCount()
Returns number of projects in batch list.
wxString userDefindSequence
static const wxString outputMode[]
void OnChangeUserDefined(wxCommandEvent &e)
void SetMissing(int index)
int GetProjectCountByPath(wxString path)
unsigned int getHeight() const
get panorama height
static const wxString HDRMergeType[]
void AppendProject(Project *project)
virtual wxObject * DoCreateResource()
wxString GetText(int row, int column)
void OnEditProject(wxCommandEvent &e)
HuginBase::PanoramaOptions options
void ChangePrefix(int index, wxString newPrefix)
void ChangeUserDefined(int index, wxString newUserDefined)
std::set< unsigned int > UIntSet
virtual bool CanHandle(wxXmlNode *node)
void OnContextMenu(wxContextMenuEvent &e)
IMPLEMENT_DYNAMIC_CLASS(wxTreeListHeaderWindow, wxWindow)
bool UpdateStatus(int index, Project *project)
Batch processor for Hugin with GUI.
void OnRemoveProject(wxCommandEvent &e)
Project * GetProject(int index)
Returns project at index.
void OnChangePrefix(wxCommandEvent &e)
wxString GetLongerFormatName(std::string str)
static const wxString blendingMechanism[]
unsigned int getWidth() const
HuginBase::UIntSet GetSelectedProjects()
wxString GetAttributeString(int i, Project *project)
static const wxString fileFormat[]
std::string outputImageType
void ReloadProject(int index, Project *project)
void OnChar(wxKeyEvent &e)
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
void OnColumnWidthChange(wxListEvent &event)
int GetProjectId(int index)
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
void SwapProject(int index)