Card data in images (minimum viable)

* remove wxEmptyString

* improve style tab carousel

* create web request window

* add drop target and drop source
This commit is contained in:
GenevensiS
2025-11-28 10:42:30 +01:00
committed by GitHub
parent f5b5c0968d
commit cf0a84a8a7
49 changed files with 815 additions and 399 deletions
+16 -17
View File
@@ -40,10 +40,10 @@ CardsPanel::CardsPanel(Window* parent, int id)
link_viewer_2 = new CardViewer(this, ID_CARD_LINK_VIEWER);
link_viewer_3 = new CardViewer(this, ID_CARD_LINK_VIEWER);
link_viewer_4 = new CardViewer(this, ID_CARD_LINK_VIEWER);
link_relation_1 = new wxStaticText(this, ID_CARD_LINK_RELATION_1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
link_relation_2 = new wxStaticText(this, ID_CARD_LINK_RELATION_2, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
link_relation_3 = new wxStaticText(this, ID_CARD_LINK_RELATION_3, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
link_relation_4 = new wxStaticText(this, ID_CARD_LINK_RELATION_4, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
link_relation_1 = new wxStaticText(this, ID_CARD_LINK_RELATION_1, _(""), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
link_relation_2 = new wxStaticText(this, ID_CARD_LINK_RELATION_2, _(""), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
link_relation_3 = new wxStaticText(this, ID_CARD_LINK_RELATION_3, _(""), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
link_relation_4 = new wxStaticText(this, ID_CARD_LINK_RELATION_4, _(""), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
link_select = new wxButton(this, ID_CARD_LINK_SELECT, _BUTTON_("link select"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
link_unlink_1 = new wxButton(this, ID_CARD_LINK_UNLINK_1, _BUTTON_("unlink"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
link_unlink_2 = new wxButton(this, ID_CARD_LINK_UNLINK_2, _BUTTON_("unlink"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
@@ -56,7 +56,8 @@ CardsPanel::CardsPanel(Window* parent, int id)
collapse_notes = new HoverButton(nodes_panel, ID_COLLAPSE_NOTES, _("btn_collapse"), Color(), false);
collapse_notes->SetExtraStyle(wxWS_EX_PROCESS_UI_UPDATES);
filter = nullptr;
editor->next_in_tab_order = card_list;
editor->next_in_tab_order = card_list;
SetDropTarget(card_list->drop_target);
wxFont font = link_relation_1->GetFont();
font.SetWeight(wxFONTWEIGHT_BOLD);
link_relation_1->SetFont(font);
@@ -537,14 +538,12 @@ bool CardsPanel::canPaste() const {
else return false;
}
void CardsPanel::doPaste() {
if (card_list->canPaste()) {
card_list->doPaste();
} else {
int id = focused_control(this);
if (id == ID_EDITOR) editor->doPaste();
else if (id == ID_CARD_LINK_EDITOR) link_editor->doPaste();
else if (id == ID_NOTES) notes->doPaste();
}
if (card_list->doPaste()) return;
int id = focused_control(this);
if (id == ID_EDITOR) editor->doPaste();
else if (id == ID_CARD_LINK_EDITOR) link_editor->doPaste();
else if (id == ID_NOTES) notes->doPaste();
}
// ----------------------------------------------------------------------------- : Text selection
@@ -657,7 +656,7 @@ void CardsPanel::selectCard(const CardP& card) {
link_box_1->Show(false);
link_editor->setCard(card);
link_viewer_1->setCard(card);
//link_relation_1->SetLabel(wxEmptyString);
//link_relation_1->SetLabel(_(""));
}
if (count >= 2) {
link_box_2->Show(true);
@@ -668,7 +667,7 @@ void CardsPanel::selectCard(const CardP& card) {
} else {
link_box_2->Show(false);
link_viewer_2->setCard(card);
//link_relation_2->SetLabel(wxEmptyString);
//link_relation_2->SetLabel(_(""));
}
if (count >= 3) {
link_box_3->Show(true);
@@ -679,7 +678,7 @@ void CardsPanel::selectCard(const CardP& card) {
} else {
link_box_3->Show(false);
link_viewer_3->setCard(card);
//link_relation_3->SetLabel(wxEmptyString);
//link_relation_3->SetLabel(_(""));
}
if (count >= 4) {
link_box_4->Show(true);
@@ -690,7 +689,7 @@ void CardsPanel::selectCard(const CardP& card) {
} else {
link_box_4->Show(false);
link_viewer_4->setCard(card);
//link_relation_4->SetLabel(wxEmptyString);
//link_relation_4->SetLabel(_(""));
}
if (count >= 5) {
queue_message(MESSAGE_WARNING, "DEBUG More than 4 linked cards found for card: " + card->identification());