Main menu of the plugin. More...
#include <menu.h>

Public Member Functions | |
| Menu (cPlugin *plugin, const SetupData &setup, Sudoku::PuzzleGame *&puzzle) | |
| Constructor. | |
| virtual | ~Menu () |
| Destructor. | |
| virtual void | Show () |
| Display the menu on the OSD. | |
| virtual eOSState | ProcessKey (eKeys key) |
| Process user events. | |
| eOSState | generate () |
| Generate a new puzzle. | |
| eOSState | load () |
| Load a puzzle. | |
| eOSState | save () |
| Save the puzzle. | |
| eOSState | undo () |
| Undo last action. | |
| eOSState | redo () |
| Redo last action. | |
| eOSState | toggle_mark () |
| Mark/unmark the current cell. | |
| eOSState | next_cell () |
| Move the cursor to the next free cell with minimal possible numbers. | |
| eOSState | next_number () |
| Set the next possible number for the current cell. | |
| eOSState | reset () |
| Reset the puzzle. | |
| eOSState | open_setup () |
| Open setup menu. | |
| eOSState | exit () |
| Exit plugin menu. | |
Private Member Functions | |
| void | paint () |
| Paint all pieces of the menu. | |
Private Attributes | |
| cPlugin * | plugin |
| const SetupData & | setup |
| Sudoku::PuzzleGame *& | puzzle |
| int | xPos |
| int | yPos |
| cOsd * | osd |
| Bitmap * | info |
| const char * | infoText |
| bool | new_puzzle_request |
| const cFont * | maxi_font |
| const cFont * | mini_font |
| CommandMenu * | command_menu |
| ListMenu * | list_menu |
| cMenuSetupPage * | setup_menu |
| cString | listfile |
Main menu of the plugin.
Definition at line 44 of file menu.h.
| Menu::Menu | ( | cPlugin * | plugin, | |
| const SetupData & | setup, | |||
| Sudoku::PuzzleGame *& | puzzle | |||
| ) |
Constructor.
Definition at line 66 of file menu.cpp.
References command_menu, SudokuPlugin::SetupData::givens_count, GRID_SIZE, info, infoText, list_menu, listfile, SudokuPlugin::SetupData::maxi_font, maxi_font, SudokuPlugin::SetupData::maxi_font_height, SudokuPlugin::SetupData::maxi_font_width, SudokuPlugin::SetupData::mini_font, mini_font, SudokuPlugin::SetupData::mini_font_height, SudokuPlugin::SetupData::mini_font_width, new_puzzle_request, osd, setup_menu, SUDOKU_LIST, SudokuPlugin::SetupData::symmetric, xPos, and yPos.
| Menu::~Menu | ( | ) | [virtual] |
Destructor.
Definition at line 88 of file menu.cpp.
References command_menu, info, list_menu, maxi_font, mini_font, osd, and setup_menu.
| eOSState Menu::exit | ( | ) |
| eOSState Menu::generate | ( | ) |
Generate a new puzzle.
Definition at line 247 of file menu.cpp.
References Sudoku::Puzzle::generate(), SudokuPlugin::SetupData::givens_count, puzzle, setup, and SudokuPlugin::SetupData::symmetric.
Referenced by ProcessKey().
| eOSState Menu::load | ( | ) |
| eOSState Menu::next_cell | ( | ) |
Move the cursor to the next free cell with minimal possible numbers.
Definition at line 297 of file menu.cpp.
References Sudoku::PuzzleGame::get_pos(), Sudoku::Puzzle::next_cell(), puzzle, and Sudoku::PuzzleGame::set_pos().
| eOSState Menu::next_number | ( | ) |
Set the next possible number for the current cell.
Definition at line 306 of file menu.cpp.
References Sudoku::PuzzleGame::get_pos(), Sudoku::Puzzle::next_number(), puzzle, and Sudoku::PuzzleGame::set_with_history().
| eOSState Menu::open_setup | ( | ) |
| void Menu::paint | ( | ) | [private] |
Paint all pieces of the menu.
Definition at line 338 of file menu.cpp.
References AMBIG_BG, AMBIG_FG, Sudoku::Puzzle::ambiguous(), CELL_POS, CELL_SIZE, Sudoku::Pos::col(), CURSUR_COLOR, Sudoku::DIM, Sudoku::Puzzle::error(), ERROR_BG, ERROR_FG, Sudoku::Numbers::get(), Sudoku::PuzzleGame::get_pos(), Sudoku::Puzzle::given(), GIVEN_BG, GIVEN_FG, GRID_COLOR, GRID_SIZE, info, infoText, SudokuPlugin::SetupData::mark_ambiguous, SudokuPlugin::SetupData::mark_errors, Sudoku::Puzzle::marked(), MARKED_BG, MARKED_FG, maxi_font, mini_font, NUMBER_BG, NUMBER_FG, osd, POSSIBLE_BG, POSSIBLE_FG, Sudoku::Puzzle::possible_number(), puzzle, Sudoku::RDIM, Sudoku::Pos::row(), setup, SudokuPlugin::SetupData::show_possibles_digits, SudokuPlugin::SetupData::show_possibles_pattern, SudokuPlugin::Bitmap::text(), TRANS, SudokuPlugin::SetupData::transparency, xPos, and yPos.
Referenced by ProcessKey(), and Show().
| eOSState Menu::ProcessKey | ( | eKeys | key | ) | [virtual] |
Process user events.
Definition at line 115 of file menu.cpp.
References SudokuPlugin::CommandList::command(), command_menu, exit(), generate(), Sudoku::PuzzleGame::get_pos(), SudokuPlugin::CommandMenu::get_selected_command(), SudokuPlugin::ListMenu::get_selected_sudoku(), infoText, SudokuPlugin::SetupData::key_green, SudokuPlugin::SetupData::key_red, SudokuPlugin::SetupData::key_yellow, list_menu, Sudoku::Puzzle::load_from_dump(), SudokuPlugin::SetupData::maxi_font, maxi_font, SudokuPlugin::SetupData::maxi_font_height, SudokuPlugin::SetupData::maxi_font_width, SudokuPlugin::SetupData::mini_font, mini_font, SudokuPlugin::SetupData::mini_font_height, SudokuPlugin::SetupData::mini_font_width, new_puzzle_request, Sudoku::Pos::next_col(), Sudoku::Pos::next_row(), osd, paint(), Sudoku::Pos::prev_col(), Sudoku::Pos::prev_row(), SudokuPlugin::ListMenu::ProcessKey(), SudokuPlugin::CommandMenu::ProcessKey(), puzzle, Sudoku::PuzzleGame::set_pos(), Sudoku::PuzzleGame::set_with_history(), setup, setup_menu, Show(), and Sudoku::Puzzle::solved().
| eOSState Menu::redo | ( | ) |
Redo last action.
Definition at line 283 of file menu.cpp.
References Sudoku::PuzzleGame::forward(), and puzzle.
| eOSState Menu::reset | ( | ) |
Reset the puzzle.
Definition at line 313 of file menu.cpp.
References SudokuPlugin::SetupData::clear_marks, puzzle, Sudoku::PuzzleGame::reset(), and setup.
| eOSState Menu::save | ( | ) |
| void Menu::Show | ( | ) | [virtual] |
| eOSState Menu::toggle_mark | ( | ) |
Mark/unmark the current cell.
Definition at line 290 of file menu.cpp.
References Sudoku::PuzzleGame::get_pos(), puzzle, and Sudoku::Puzzle::toggle_mark().
| eOSState Menu::undo | ( | ) |
Undo last action.
Definition at line 276 of file menu.cpp.
References Sudoku::PuzzleGame::backward(), and puzzle.
CommandMenu* SudokuPlugin::Menu::command_menu [private] |
Definition at line 56 of file menu.h.
Referenced by Menu(), ProcessKey(), and ~Menu().
Bitmap* SudokuPlugin::Menu::info [private] |
const char* SudokuPlugin::Menu::infoText [private] |
Definition at line 52 of file menu.h.
Referenced by Menu(), paint(), and ProcessKey().
ListMenu* SudokuPlugin::Menu::list_menu [private] |
cString SudokuPlugin::Menu::listfile [private] |
const cFont* SudokuPlugin::Menu::maxi_font [private] |
const cFont* SudokuPlugin::Menu::mini_font [private] |
bool SudokuPlugin::Menu::new_puzzle_request [private] |
Definition at line 53 of file menu.h.
Referenced by Menu(), and ProcessKey().
cOsd* SudokuPlugin::Menu::osd [private] |
Definition at line 50 of file menu.h.
Referenced by load(), Menu(), open_setup(), paint(), ProcessKey(), save(), Show(), and ~Menu().
cPlugin* SudokuPlugin::Menu::plugin [private] |
Definition at line 46 of file menu.h.
Referenced by open_setup().
Sudoku::PuzzleGame*& SudokuPlugin::Menu::puzzle [private] |
Definition at line 48 of file menu.h.
Referenced by generate(), next_cell(), next_number(), paint(), ProcessKey(), redo(), reset(), save(), toggle_mark(), and undo().
const SetupData& SudokuPlugin::Menu::setup [private] |
Definition at line 47 of file menu.h.
Referenced by generate(), paint(), ProcessKey(), and reset().
cMenuSetupPage* SudokuPlugin::Menu::setup_menu [private] |
Definition at line 58 of file menu.h.
Referenced by Menu(), open_setup(), ProcessKey(), and ~Menu().
int SudokuPlugin::Menu::xPos [private] |
int SudokuPlugin::Menu::yPos [private] |
1.6.3