28 #include "wx/msw/wrapwin.h"
41 bool ProjectListBox::Create(wxWindow* parent, wxWindowID
id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
43 if (! wxListCtrl::Create(parent,
id, pos, size, wxLC_REPORT | style) )
57 this->InsertColumn(0,_(
"ID"));
58 this->InsertColumn(1,_(
"Project"));
59 this->InsertColumn(2,_(
"Output prefix"));
60 this->InsertColumn(3,_(
"Status"));
61 this->InsertColumn(4,_(
"Last modified"));
62 this->InsertColumn(5,_(
"Output format"));
63 this->InsertColumn(6,_(
"Projection"));
64 this->InsertColumn(7,_(
"Size"));
65 this->InsertColumn(8, _(
"User defined sequence"));
68 for(
int i=0; i < GetColumnCount() ; i++ )
70 int width = wxConfigBase::Get()->Read(wxString::Format(wxT(
"/BatchList/ColumnWidth%d"),
columns[i] ), -1);
73 SetColumnWidth(i, width);
100 this->InsertItem(this->GetItemCount(),project->
path);
104 this->InsertItem(this->GetItemCount(),_T(
""));
105 this->SetItem(this->GetItemCount()-1,i,project->
path);
110 this->InsertItem(this->GetItemCount(),_T(
""));
118 for(
unsigned int i=1; i<
columns.GetCount(); i++)
125 this->InsertItem(this->GetItemCount(),_T(
""));
133 if(colIndex!=wxNOT_FOUND)
143 if (colIndex != wxNOT_FOUND)
152 SetItemState(index, 0, wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED);
167 while(index<this->GetItemCount())
169 if(
GetText(index,0).Cmp(wxString::Format(_(
"%d"),
id))==0)
181 for(
int i=0; i<this->GetItemCount(); i++)
194 if(!
GetText(index,0).ToLong(&
id))
196 wxMessageBox(_(
"Error, cannot convert id"),_(
"Error"));
204 for (
int i = 0; i<GetItemCount(); i++)
206 if (GetItemState(i, wxLIST_STATE_SELECTED) & wxLIST_STATE_SELECTED)
218 item.SetColumn(column);
219 item.SetMask(wxLIST_MASK_TEXT);
221 return item.GetText();
226 for(
unsigned int i=0; i<
columns.GetCount(); i++)
234 if(index>=0 && index<this->GetItemCount())
236 SetItemState(index,wxLIST_STATE_SELECTED,wxLIST_STATE_SELECTED);
242 for(
int i=0; i< this->GetColumnCount(); i++)
246 this->SetItem(index,i,_(
"File missing"));
250 this->SetItem(index,i,_T(
""));
258 for(
int i=0; i<GetColumnCount(); i++)
261 SetItem(index,i,
GetText(index+1,i));
262 SetItem(index+1,i,temp);
270 for(
int i=0; i< this->GetColumnCount(); i++)
275 if(newStatus.Cmp(
GetText(index,i))!=0)
278 this->SetItem(index,i,newStatus);
293 return wxString::Format(_T(
"%ld"),project->
id);
295 return project->
path;
300 wxFileName prefix(project->
prefix);
301 wxFileName projectFile(project->
path);
302 prefix.MakeRelativeTo(projectFile.GetPath());
303 return prefix.GetFullPath();
307 return _(
"Assistant");
315 if (project->
modDate.IsValid())
317 return project->
modDate.Format();
320 return wxEmptyString;
328 return wxEmptyString;
332 pano_projection_features proj;
335 wxString str2(proj.name, wxConvLocal);
336 return wxGetTranslation(str2);
343 return wxEmptyString;
352 return wxEmptyString;
358 return wxEmptyString;
390 int col =
event.GetColumn();
391 wxConfigBase::Get()->Write(wxString::Format(wxT(
"/BatchList/ColumnWidth%d"),
columns[col]), GetColumnWidth(col));
398 wxPoint point = e.GetPosition();
400 if ((point.x == -1) && (point.y == -1))
402 wxSize size = GetSize();
403 point.x = size.x / 2;
404 point.y = size.y / 2;
408 point = ScreenToClient(point);
410 if (selected.size() == 1)
418 PopupMenu(&menu, point.x, point.y);
422 if (selected.size() > 1)
427 bool isSameTarget =
true;
428 for (
const auto& i : selected)
432 isSameTarget =
false;
442 PopupMenu(&menu, point.x, point.y);
449 switch (e.GetKeyCode())
452 case WXK_NUMPAD_DELETE:
454 wxCommandEvent ev(wxEVT_TOOL, XRCID(
"tool_remove"));
455 GetParent()->GetEventHandler()->AddPendingEvent(ev);
459 case WXK_NUMPAD_INSERT:
461 wxCommandEvent ev(wxEVT_MENU, XRCID(
"menu_add"));
462 GetParent()->GetEventHandler()->AddPendingEvent(ev);
467 wxCommandEvent ev(wxEVT_TOOL, XRCID(
"tool_cancel"));
468 GetParent()->GetEventHandler()->AddPendingEvent(ev);
477 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"button_prefix"));
478 GetParent()->GetEventHandler()->AddPendingEvent(ev);
483 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"button_reset"));
484 GetParent()->GetEventHandler()->AddPendingEvent(ev);
489 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"button_edit"));
490 GetParent()->GetEventHandler()->AddPendingEvent(ev);
495 wxCommandEvent ev(wxEVT_COMMAND_TOOL_CLICKED, XRCID(
"tool_remove"));
496 GetParent()->GetEventHandler()->AddPendingEvent(ev);
501 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"button_user_defined"));
502 GetParent()->GetEventHandler()->AddPendingEvent(ev);
512 _T(
"TIFF_multilayer"),
513 _T(
"TIFF_multilayer_mask"),
527 _T(
"FILEFORMAT_NULL")
538 _T(
"HDRMERGE_AVERAGE"),
539 _T(
"HDRMERGE_DEGHOST")
545 _T(
"PTBLENDER_BLEND"),
547 _T(
"SMARTBLEND_BLEND"),
554 : wxListCtrlXmlHandler()
563 cp->Create(m_parentAsWindow,
565 GetPosition(), GetSize(),
566 GetStyle(wxT(
"style")),
576 return IsOfClass(node, wxT(
"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[]
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxT("panel"))
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)
void OnColumnWidthChange(wxListEvent &event)
int GetProjectId(int index)
void SwapProject(int index)