22#include "../../common/datastructures.h"
33 void LoadImage(
const wxString& filename, wxBitmapType = wxBITMAP_TYPE_ANY,
bool doUpdateFrame =
true);
42 void OnSize(wxSizeEvent& event);
60 void OnEnter(wxMouseEvent& event);
61 void OnFocus(wxFocusEvent& event);
65 void OnSaveAs(wxCommandEvent& event);
66 void OnCopy(wxCommandEvent& event);
void OnCopy(wxCommandEvent &event)
This member function handles the "copy" toolbar option of the parent frame.
void OnLoseFocus(wxFocusEvent &event)
On lose focus event handler.
void OnSaveAs(wxCommandEvent &event)
This member function handles the "save as" toolbar option of the parent frame.
bool LoadNextImage(const wxFileName &filename)
This method tries to load the desired image file and returns, whether it was successful or not.
void paintNow()
Alternatively, you can use a clientDC to paint on the panel at any time. Using this generally does no...
void keyPressed(wxKeyEvent &event)
This function closes the parent frame, if the user presses the ESC key.
double getRelation() const
void OnSize(wxSizeEvent &event)
Here we call refresh to tell the panel to draw itself again. So when the user resizes the image panel...
ImagePanel(wxFrame *parent, wxString file, wxBitmapType format)
ImagePanel constructor.
void paintEvent(wxPaintEvent &evt)
Called by the system of by wxWidgets when the panel needs to be redrawn. You can also trigger this ca...
void OnEnter(wxMouseEvent &event)
On enter event handler focuses this panel.
void OnFocus(wxFocusEvent &event)
On focus event handler.
void OnNavigationKey(wxNavigationKeyEvent &event)
This member function chooses the next or previous image in the file list, depending on the arrow key ...
void render(wxDC &dc)
Here we do the actual rendering. I put it in a separate method so that it can work no matter what typ...
void OnPreviousImage(wxCommandEvent &event)
This member function displays the previous image in the current folder.
void OnNextImage(wxCommandEvent &event)
This member function displays the next image in the current folder.
wxArrayString getFileList(const wxString &dirname)
This method returns a list of all files in the current folder (used for iterating over all images).
void LoadImage(const wxString &filename, wxBitmapType=wxBITMAP_TYPE_ANY, bool doUpdateFrame=true)
This method loads the specified file, updates the parent frame's size (if desired) and displays the i...
auto format(const std::locale &loc, const CharT *fmt, const Streamable &tp) -> decltype(to_stream(std::declval< std::basic_ostream< CharT > & >(), fmt, tp), std::basic_string< CharT >{})