Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
78c2ab5e
Commit
78c2ab5e
authored
Sep 02, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more keyboard related tweaks.
parent
edd8649d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
14 deletions
+32
-14
src/gui/control/card_editor.cpp
src/gui/control/card_editor.cpp
+14
-10
src/gui/control/card_editor.hpp
src/gui/control/card_editor.hpp
+1
-1
src/gui/control/text_ctrl.cpp
src/gui/control/text_ctrl.cpp
+6
-1
src/gui/control/text_ctrl.hpp
src/gui/control/text_ctrl.hpp
+2
-1
src/gui/new_window.cpp
src/gui/new_window.cpp
+1
-0
src/gui/set/cards_panel.cpp
src/gui/set/cards_panel.cpp
+6
-0
src/gui/set/cards_panel.hpp
src/gui/set/cards_panel.hpp
+1
-0
src/gui/set/keywords_panel.cpp
src/gui/set/keywords_panel.cpp
+1
-1
No files found.
src/gui/control/card_editor.cpp
View file @
78c2ab5e
...
@@ -79,17 +79,23 @@ void DataEditor::selectFirst() {
...
@@ -79,17 +79,23 @@ void DataEditor::selectFirst() {
selectByTabPos
(
0
);
selectByTabPos
(
0
);
}
}
bool
DataEditor
::
selectNext
()
{
bool
DataEditor
::
selectNext
()
{
return
selectByTabPos
(
currentTabPos
()
+
1
);
return
selectByTabPos
(
currentTabPos
()
+
1
,
true
);
}
}
bool
DataEditor
::
selectPrevious
()
{
bool
DataEditor
::
selectPrevious
()
{
return
selectByTabPos
(
currentTabPos
()
-
1
);
return
selectByTabPos
(
currentTabPos
()
-
1
,
false
);
}
}
bool
DataEditor
::
selectByTabPos
(
int
tab_pos
)
{
bool
DataEditor
::
selectByTabPos
(
int
tab_pos
,
bool
forward
)
{
if
(
tab_pos
>=
0
&&
(
size_t
)
tab_pos
<
by_tab_index
.
size
())
{
while
(
tab_pos
>=
0
&&
(
size_t
)
tab_pos
<
by_tab_index
.
size
())
{
select
(
by_tab_index
[
tab_pos
]);
ValueViewer
*
v
=
by_tab_index
[
tab_pos
];
return
true
;
if
(
v
->
getField
()
->
editable
)
{
}
else
if
(
!
by_tab_index
.
empty
())
{
select
(
v
);
return
true
;
}
// not enabled, maybe the next one?
tab_pos
+=
forward
?
1
:
-
1
;
}
if
(
!
by_tab_index
.
empty
())
{
// also select something! so when we regain focus the selected editor makes sense
// also select something! so when we regain focus the selected editor makes sense
if
(
tab_pos
<
0
)
select
(
by_tab_index
.
back
());
if
(
tab_pos
<
0
)
select
(
by_tab_index
.
back
());
else
select
(
by_tab_index
.
front
());
else
select
(
by_tab_index
.
front
());
...
@@ -235,7 +241,7 @@ void DataEditor::onMotion(wxMouseEvent& ev) {
...
@@ -235,7 +241,7 @@ void DataEditor::onMotion(wxMouseEvent& ev) {
if
(
!
HasCapture
())
{
if
(
!
HasCapture
())
{
// find editor under mouse
// find editor under mouse
ValueViewer
*
new_hovered_viewer
=
nullptr
;
ValueViewer
*
new_hovered_viewer
=
nullptr
;
FOR_EACH_
EDITOR_REVERSE
{
// find high z index fields first
FOR_EACH_
REVERSE
(
v
,
viewers
)
{
// find high z index fields first
if
(
v
->
containsPoint
(
pos
)
&&
v
->
getField
()
->
editable
)
{
if
(
v
->
containsPoint
(
pos
)
&&
v
->
getField
()
->
editable
)
{
new_hovered_viewer
=
v
.
get
();
new_hovered_viewer
=
v
.
get
();
break
;
break
;
...
@@ -305,8 +311,6 @@ void DataEditor::selectFieldNoEvents(const RealPoint& p) {
...
@@ -305,8 +311,6 @@ void DataEditor::selectFieldNoEvents(const RealPoint& p) {
return
;
return
;
}
}
}
}
//% current_viewer = nullptr;
//% current_editor = nullptr;
}
}
RealPoint
DataEditor
::
mousePoint
(
const
wxMouseEvent
&
ev
)
{
RealPoint
DataEditor
::
mousePoint
(
const
wxMouseEvent
&
ev
)
{
...
...
src/gui/control/card_editor.hpp
View file @
78c2ab5e
...
@@ -126,7 +126,7 @@ class DataEditor : public CardViewer {
...
@@ -126,7 +126,7 @@ class DataEditor : public CardViewer {
void
createTabIndex
();
void
createTabIndex
();
/// Select the field with the given position in the by_tab_index list
/// Select the field with the given position in the by_tab_index list
/** Returns success */
/** Returns success */
bool
selectByTabPos
(
int
tab_pos
);
bool
selectByTabPos
(
int
tab_pos
,
bool
forward
=
true
);
/// Find the tab pos of the current viewer, returns -1 if not found
/// Find the tab pos of the current viewer, returns -1 if not found
int
currentTabPos
()
const
;
int
currentTabPos
()
const
;
};
};
...
...
src/gui/control/text_ctrl.cpp
View file @
78c2ab5e
...
@@ -18,7 +18,6 @@ DECLARE_TYPEOF_COLLECTION(ValueViewerP);
...
@@ -18,7 +18,6 @@ DECLARE_TYPEOF_COLLECTION(ValueViewerP);
TextCtrl
::
TextCtrl
(
Window
*
parent
,
int
id
,
bool
multi_line
,
long
style
)
TextCtrl
::
TextCtrl
(
Window
*
parent
,
int
id
,
bool
multi_line
,
long
style
)
:
DataEditor
(
parent
,
id
,
style
)
:
DataEditor
(
parent
,
id
,
style
)
,
value
(
nullptr
)
,
multi_line
(
multi_line
)
,
multi_line
(
multi_line
)
{}
{}
TextCtrl
::~
TextCtrl
()
{}
TextCtrl
::~
TextCtrl
()
{}
...
@@ -36,6 +35,12 @@ void TextCtrl::draw(DC& dc) {
...
@@ -36,6 +35,12 @@ void TextCtrl::draw(DC& dc) {
}
}
}
}
bool
TextCtrl
::
AcceptsFocus
()
const
{
return
wxControl
::
AcceptsFocus
()
&&
!
viewers
.
empty
()
&&
static_cast
<
FakeTextValue
&>
(
*
viewers
.
front
()
->
getValue
()).
editable
;
}
TextStyle
&
TextCtrl
::
getStyle
()
{
TextStyle
&
TextCtrl
::
getStyle
()
{
assert
(
!
viewers
.
empty
());
assert
(
!
viewers
.
empty
());
...
...
src/gui/control/text_ctrl.hpp
View file @
78c2ab5e
...
@@ -55,6 +55,8 @@ class TextCtrl : public DataEditor {
...
@@ -55,6 +55,8 @@ class TextCtrl : public DataEditor {
virtual
void
draw
(
DC
&
dc
);
virtual
void
draw
(
DC
&
dc
);
virtual
bool
AcceptsFocus
()
const
;
virtual
void
onChangeSet
();
virtual
void
onChangeSet
();
protected:
protected:
...
@@ -62,7 +64,6 @@ class TextCtrl : public DataEditor {
...
@@ -62,7 +64,6 @@ class TextCtrl : public DataEditor {
virtual
wxSize
DoGetBestSize
()
const
;
virtual
wxSize
DoGetBestSize
()
const
;
private:
private:
String
*
value
;
///< Value to edit
bool
multi_line
;
///< Multi line text control?
bool
multi_line
;
///< Multi line text control?
DECLARE_EVENT_TABLE
();
DECLARE_EVENT_TABLE
();
...
...
src/gui/new_window.cpp
View file @
78c2ab5e
...
@@ -53,6 +53,7 @@ NewSetWindow::NewSetWindow(Window* parent)
...
@@ -53,6 +53,7 @@ NewSetWindow::NewSetWindow(Window* parent)
}
catch
(
FileNotFoundError
e
)
{
}
catch
(
FileNotFoundError
e
)
{
handle_error
(
e
);
handle_error
(
e
);
}
}
game_list
->
SetFocus
();
UpdateWindowUI
(
wxUPDATE_UI_RECURSE
);
UpdateWindowUI
(
wxUPDATE_UI_RECURSE
);
}
}
...
...
src/gui/set/cards_panel.cpp
View file @
78c2ab5e
...
@@ -37,6 +37,7 @@ CardsPanel::CardsPanel(Window* parent, int id)
...
@@ -37,6 +37,7 @@ CardsPanel::CardsPanel(Window* parent, int id)
notes
=
new
TextCtrl
(
notesP
,
ID_NOTES
,
true
);
notes
=
new
TextCtrl
(
notesP
,
ID_NOTES
,
true
);
collapse_notes
=
new
HoverButton
(
notesP
,
ID_COLLAPSE_NOTES
,
_
(
"btn_collapse"
),
wxNullColour
,
false
);
collapse_notes
=
new
HoverButton
(
notesP
,
ID_COLLAPSE_NOTES
,
_
(
"btn_collapse"
),
wxNullColour
,
false
);
collapse_notes
->
SetExtraStyle
(
wxWS_EX_PROCESS_UI_UPDATES
);
collapse_notes
->
SetExtraStyle
(
wxWS_EX_PROCESS_UI_UPDATES
);
filter
=
nullptr
;
// init sizer for notes panel
// init sizer for notes panel
wxSizer
*
sn
=
new
wxBoxSizer
(
wxVERTICAL
);
wxSizer
*
sn
=
new
wxBoxSizer
(
wxVERTICAL
);
wxSizer
*
sc
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxSizer
*
sc
=
new
wxBoxSizer
(
wxHORIZONTAL
);
...
@@ -124,6 +125,9 @@ void CardsPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
...
@@ -124,6 +125,9 @@ void CardsPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
tb
->
AddTool
(
ID_CARD_REMOVE
,
_
(
""
),
load_resource_tool_image
(
_
(
"card_del"
)),
wxNullBitmap
,
wxITEM_NORMAL
,
_TOOLTIP_
(
"remove card"
),
_HELP_
(
"remove card"
));
tb
->
AddTool
(
ID_CARD_REMOVE
,
_
(
""
),
load_resource_tool_image
(
_
(
"card_del"
)),
wxNullBitmap
,
wxITEM_NORMAL
,
_TOOLTIP_
(
"remove card"
),
_HELP_
(
"remove card"
));
tb
->
AddSeparator
();
tb
->
AddSeparator
();
tb
->
AddTool
(
ID_CARD_ROTATE
,
_
(
""
),
load_resource_tool_image
(
_
(
"card_rotate"
)),
wxNullBitmap
,
wxITEM_NORMAL
,
_TOOLTIP_
(
"rotate card"
),
_HELP_
(
"rotate card"
));
tb
->
AddTool
(
ID_CARD_ROTATE
,
_
(
""
),
load_resource_tool_image
(
_
(
"card_rotate"
)),
wxNullBitmap
,
wxITEM_NORMAL
,
_TOOLTIP_
(
"rotate card"
),
_HELP_
(
"rotate card"
));
//% tb->AddSeparator();
//% if (!filter) filter = new wxTextCtrl(tb, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER);
//% tb->AddControl(filter);
tb
->
Realize
();
tb
->
Realize
();
// Menus
// Menus
mb
->
Insert
(
2
,
menuCard
,
_MENU_
(
"cards"
));
mb
->
Insert
(
2
,
menuCard
,
_MENU_
(
"cards"
));
...
@@ -139,9 +143,11 @@ void CardsPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
...
@@ -139,9 +143,11 @@ void CardsPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
tb
->
DeleteTool
(
ID_CARD_ADD
);
tb
->
DeleteTool
(
ID_CARD_ADD
);
tb
->
DeleteTool
(
ID_CARD_REMOVE
);
tb
->
DeleteTool
(
ID_CARD_REMOVE
);
tb
->
DeleteTool
(
ID_CARD_ROTATE
);
tb
->
DeleteTool
(
ID_CARD_ROTATE
);
//% tb->DeleteTool(filter->GetId()); filter = nullptr;
// HACK: hardcoded size of rest of toolbar
// HACK: hardcoded size of rest of toolbar
tb
->
DeleteToolByPos
(
12
);
// delete separator
tb
->
DeleteToolByPos
(
12
);
// delete separator
tb
->
DeleteToolByPos
(
12
);
// delete separator
tb
->
DeleteToolByPos
(
12
);
// delete separator
//% tb->DeleteToolByPos(12); // delete separator
// Menus
// Menus
mb
->
Remove
(
3
);
mb
->
Remove
(
3
);
mb
->
Remove
(
2
);
mb
->
Remove
(
2
);
...
...
src/gui/set/cards_panel.hpp
View file @
78c2ab5e
...
@@ -77,6 +77,7 @@ class CardsPanel : public SetWindowPanel {
...
@@ -77,6 +77,7 @@ class CardsPanel : public SetWindowPanel {
ImageCardList
*
card_list
;
ImageCardList
*
card_list
;
TextCtrl
*
notes
;
TextCtrl
*
notes
;
HoverButton
*
collapse_notes
;
HoverButton
*
collapse_notes
;
wxTextCtrl
*
filter
;
// --------------------------------------------------- : Menus & tools
// --------------------------------------------------- : Menus & tools
IconMenu
*
menuCard
,
*
menuFormat
;
IconMenu
*
menuCard
,
*
menuFormat
;
...
...
src/gui/set/keywords_panel.cpp
View file @
78c2ab5e
...
@@ -39,8 +39,8 @@ KeywordsPanel::KeywordsPanel(Window* parent, int id)
...
@@ -39,8 +39,8 @@ KeywordsPanel::KeywordsPanel(Window* parent, int id)
mode
=
new
wxChoice
(
panel
,
ID_KEYWORD_MODE
,
wxDefaultPosition
,
wxDefaultSize
,
0
,
nullptr
);
mode
=
new
wxChoice
(
panel
,
ID_KEYWORD_MODE
,
wxDefaultPosition
,
wxDefaultSize
,
0
,
nullptr
);
match
=
new
TextCtrl
(
panel
,
ID_MATCH
,
false
);
match
=
new
TextCtrl
(
panel
,
ID_MATCH
,
false
);
add_param
=
new
wxButton
(
panel
,
ID_KEYWORD_ADD_PARAM
,
_BUTTON_
(
"insert parameter"
));
add_param
=
new
wxButton
(
panel
,
ID_KEYWORD_ADD_PARAM
,
_BUTTON_
(
"insert parameter"
));
ref_param
=
new
wxButton
(
panel
,
ID_KEYWORD_REF_PARAM
,
_BUTTON_
(
"refer parameter"
));
reminder
=
new
TextCtrl
(
panel
,
ID_REMINDER
,
true
);
// allow multiline for wordwrap
reminder
=
new
TextCtrl
(
panel
,
ID_REMINDER
,
true
);
// allow multiline for wordwrap
ref_param
=
new
wxButton
(
panel
,
ID_KEYWORD_REF_PARAM
,
_BUTTON_
(
"refer parameter"
));
rules
=
new
TextCtrl
(
panel
,
ID_RULES
,
true
);
rules
=
new
TextCtrl
(
panel
,
ID_RULES
,
true
);
errors
=
new
wxStaticText
(
panel
,
wxID_ANY
,
_
(
""
));
errors
=
new
wxStaticText
(
panel
,
wxID_ANY
,
_
(
""
));
errors
->
SetForegroundColour
(
*
wxRED
);
errors
->
SetForegroundColour
(
*
wxRED
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment