Class: GamesAndRpgParadise::GUI::LibUI::CardCollection

Inherits:
Object
  • Object
show all
Includes:
MagicTheGathering::CardCollectionModule, LibuiParadise::Extensions
Defined in:
lib/games_and_rpg_paradise/gui/libui/magic_the_gathering/card_collection/card_collection.rb

Overview

GamesAndRpgParadise::GUI::LibUI::CardCollection

Constant Summary

Constants included from MagicTheGathering::CardCollectionModule

MagicTheGathering::CardCollectionModule::ARRAY_CONTAINING_INFORMATION_ABOUT_ALL_CARDS, MagicTheGathering::CardCollectionModule::ARRAY_RARITY, MagicTheGathering::CardCollectionModule::BLANK_IMAGE, MagicTheGathering::CardCollectionModule::COLOUR_FOR_THE_LABEL_SHOWING_THE_CORRECT_DATE, MagicTheGathering::CardCollectionModule::DIRECTORY_CONTAINING_THE_INDIVIDUAL_CARDS_BELONGING_TO_A_THEME, MagicTheGathering::CardCollectionModule::HEIGHT, MagicTheGathering::CardCollectionModule::LOG_DIR, MagicTheGathering::CardCollectionModule::SMALLER_FONT, MagicTheGathering::CardCollectionModule::SMALLEST_FONT, MagicTheGathering::CardCollectionModule::SUPER_SMALL_FONT, MagicTheGathering::CardCollectionModule::TITLE, MagicTheGathering::CardCollectionModule::USE_THIS_FONT, MagicTheGathering::CardCollectionModule::WIDTH

Constants included from CommonExtensions

CommonExtensions::CONTROL_C_CODE, CommonExtensions::N

Instance Method Summary collapse

Methods included from MagicTheGathering::CardCollectionModule

#base_dir?, #border_size?, #cost?, #create_the_buttons, #create_the_combo_box, #create_the_labels, #create_the_small_spinner, #current_theme?, #delay_show_the_guessed_image, #determine_the_rarity_based_on_this_mouse_movement, #determine_whether_the_current_theme_is_available_locally_or_not, #do_all_actions_associated_with_the_main_combo_box_containing_the_themes, #do_change_to_use_another_model_for_the_main_entry, #do_delete_the_yaml_dataset, #do_open_the_remote_profile, #do_open_the_remote_webpage_for_the_current_card, #do_save_the_information, #do_save_this_dataset_into_the_yaml_file, #do_set_the_correct_completion_model_for_entry1, #do_show_the_modal_popover_containing_all_local_images_belonging_to_the_current_theme, #do_startup_related_tasks, #do_update_the_correct_date_entry, #does_the_yaml_file_exist?, #entry1?, #entry4?, #entry_for_the_cost?, #entry_for_the_theme?, #foil_yes_or_no?, #handle_the_action_of_the_event_box_containing_the_image_with_the_graphical_checkbox_for_determining_local_images_availability, #how_many_images_are_available_locally_in_the_current_theme?, #largest_font?, #main_combobox?, #main_font?, #n_cards?, #n_cards_registered?, #n_cards_registered_in_total?, #name_of_the_card?, #padding?, #rarity?, #reset_the_shared_module, #return_all_cards_belonging_to_this_theme, #return_all_themes?, #return_all_yaml_theme_files, #return_amount_of_the_card, #return_cost_of_the_card, #return_entry_for_the_amount_of_the_card, #return_entry_for_the_cost_of_the_card, #return_entry_for_the_name_of_the_card, #return_entry_for_the_rarity_of_the_card, #return_entry_for_the_theme_of_the_card, #return_euro_symbol, #return_name_of_the_card, #return_rarity_of_the_card, #return_string_n_cards_registered_in_total, #return_the_URL_for_cardmarket_based_on_the_entries, #return_the_assumed_local_path_to_the_directory_containing_the_images, #return_the_assumed_local_path_to_the_image, #return_the_checkbox_to_foil_or_not_to_foil, #return_the_dynamic_tooltip_for_the_image_containing_the_graphical_checkbox_for_determining_local_images_availability, #return_the_fifth_row, #return_the_foil_card_text, #return_the_icon_showing_the_theme_symbols, #return_the_sixth_row, #return_the_up_and_down_spinner, #return_theme_of_the_card, #return_up_and_down_arrows_for_the_rarity_entry, #sanitize_the_entry_for_the_cost, #sanitize_the_entry_for_the_name_of_the_card, #sanitize_the_entry_for_the_rarity_of_the_card, #small_spinner?, #smaller_font?, #smallest_font?, #super_small_font?, #the_current_theme_is_available_locally_as_well, #the_current_theme_is_not_available_locally, #theme?, #try_to_match_the_entry_onto_the_main_image_that_is_shown, #try_to_show_the_correct_theme_icon, #use_this_image_as_the_new_card_image, #yaml_file?

Methods included from Base::Extensions::CommandlineArguments

#commandline_arguments?, #filter_away_commandline_arguments, #first_argument?, #first_non_hyphened_argument?, #set_commandline_arguments

Methods included from CommonExtensions

#cat, #cd, #cliner, #copy_file, #delete, #dirname_but_retains_the_trailing_slash, #disable_colours, #ensure_that_the_log_directory_exists, #esystem, #get_user_input, #infer_the_namespace, #is_on_roebe?, #log_dir?, #mkdir, #mkdir_then_cd_into_it, #mv, #namespace?, #opne, #opnn, #project_base_directory?, #project_image_directory?, #project_yaml_directory?, #rds, #register_sigint, #remove_this_directory, #rename_file, #reset_the_internal_hash, #return_pwd, #return_today, #touch_file, #wrap, #write_what_into

Constructor Details

#initialize(run_already = true) ⇒ CardCollection

#

initialize

#


24
25
26
27
28
29
# File 'lib/games_and_rpg_paradise/gui/libui/magic_the_gathering/card_collection/card_collection.rb', line 24

def initialize(
    run_already = true
  )
  reset
  run if run_already
end

Instance Method Details

#create_skeletonObject

#

create_skeleton

#


104
105
106
107
# File 'lib/games_and_rpg_paradise/gui/libui/magic_the_gathering/card_collection/card_collection.rb', line 104

def create_skeleton
  create_the_labels
  create_the_buttons
end

#handle_the_combo_box_on_changed_eventObject

#

handle_the_combo_box_on_changed_event

Does not work right now. :(

#


94
95
96
97
98
99
# File 'lib/games_and_rpg_paradise/gui/libui/magic_the_gathering/card_collection/card_collection.rb', line 94

def handle_the_combo_box_on_changed_event
  # @combo_box_containing_the_themes.on_changed {
  #   _ = @combo_box_containing_the_themes.text?.to_s
  #   @entry2.set_text(_)
  # }
end

#resetObject

#

reset (reset tag)

#


34
35
36
# File 'lib/games_and_rpg_paradise/gui/libui/magic_the_gathering/card_collection/card_collection.rb', line 34

def reset
  reset_the_shared_module
end

#runObject

#

run

#


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/games_and_rpg_paradise/gui/libui/magic_the_gathering/card_collection/card_collection.rb', line 41

def run
  create_skeleton
  window = ui_padded_main_window(title?, width?, height?, 0)
  outer_vbox = padded_vbox
  outer_vbox.add_hsep

  hbox1 = ui_hbox
  text = ui_text('Name of the card:')
  hbox1.minimal(text, 1)
  @entry1 = ui_entry
  hbox1.minimal(@entry1, 1)
  outer_vbox.minimal(hbox1, 0)

  hbox2 = ui_hbox
  text = ui_text('Theme:')
  hbox2.minimal(text, 1)
  @entry2 = ui_entry
  hbox2.minimal(@entry2, 1)
  @combo_box_containing_the_themes = ui_combobox(return_all_themes?)
  hbox2.minimal(@combo_box_containing_the_themes)
  outer_vbox.minimal(hbox2, 0)

  hbox3 = ui_hbox
  text = ui_text('Amount:')
  hbox3.minimal(text, 1)
  @entry3 = ui_entry('1')
  hbox3.minimal(@entry3, 1)
  spinbutton = ui_spinbutton(start: 0, end: 100)
  spinbutton.set_value(1)
  spinbutton.on_changed {
    e 'HAS BEEN CHANGED'
    0
  }
  spinbox_changed_callback = proc { |pointer|
    new_value = ::LibUI.spinbox_value(pointer)
    @entry3.set_text(new_value.to_s)
    0
  }
  ::LibUI.spinbox_on_changed(spinbutton, spinbox_changed_callback, nil)

  hbox3.minimal(spinbutton)
  outer_vbox.minimal(hbox3, 0)

  window.add(outer_vbox)
  handle_the_combo_box_on_changed_event
  window.intelligent_exit
end