Tarrasch Chess GUI / src / PopupControl.h

/****************************************************************************
 * Control - My own popup menu (wxWidget popup menu is Windows specific)
 *  Author:  Bill Forster
 *  Licence: See licencing information in ChessPosition.cpp
 *  Copyright 2010, Triple Happy Ltd.  All rights reserved.
 ****************************************************************************/
#ifndef POPUPCONTROL_H
#define POPUPCONTROL_H
#include "wx/wx.h"
enum POPUP_MODE
{
    CLICK_ON_DESTINATION,
    SLIDE_TO_DESTINATION,
    BOOK_HOVER
};

class PopupControl : public wxControl
{
public:
    PopupControl( wxWindow* parent,
                  wxArrayString &strs,
                  wxArrayString &terses,
                  wxArrayString &book,
                  POPUP_MODE popup_mode,  
                  wxRect     &hover,    // if popup_mode == BOOK_HOVER
                  wxWindowID id = wxID_ANY,
                  const wxPoint& point = wxDefaultPosition );
    bool done;
    char terse_move[6];

private:
    bool upside_down;
    wxArrayString strs;
    wxArrayString terses;
    wxArrayString book;
    int sel;
    int count;
    int height;
    POPUP_MODE popup_mode;
    wxPoint point;
    wxRect  hover;
    bool release_button_to_exit;
    void Shutdown( bool inject_move );
    void OnMouseMove( wxMouseEvent& event );
    void OnMouseLeftUp( wxMouseEvent &event );
    void OnMouseLeftDown( wxMouseEvent &event );
    void OnPaint(wxPaintEvent& WXUNUSED(evt));
    void OnEraseBackground(wxEraseEvent& WXUNUSED(evt));
    void OnSize(wxSizeEvent& WXUNUSED(evt));
    void OnMouseCaptureLost( wxMouseCaptureLostEvent &event );
private:
    DECLARE_EVENT_TABLE()
};

#endif // POPUPCONTROL_H
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.