Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
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
videolan
vlc
Commits
98a42ae0
Commit
98a42ae0
authored
Dec 03, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/gui/wxwidgets: wxSplitterWindow is buggy under wxGTK so we implement our own version.
parent
a67fd4f9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
13 deletions
+48
-13
modules/gui/wxwidgets/interface.cpp
modules/gui/wxwidgets/interface.cpp
+45
-10
modules/gui/wxwidgets/interface.hpp
modules/gui/wxwidgets/interface.hpp
+3
-3
No files found.
modules/gui/wxwidgets/interface.cpp
View file @
98a42ae0
...
...
@@ -36,6 +36,8 @@
#include <vlc/aout.h>
#include "charset.h"
#include <wx/splitter.h>
/* include the toolbar graphics */
#include "bitmaps/play.xpm"
#include "bitmaps/pause.xpm"
...
...
@@ -110,6 +112,46 @@ BEGIN_EVENT_TABLE(VLCVolCtrl, wxControl)
EVT_LEFT_UP
(
VLCVolCtrl
::
OnChange
)
END_EVENT_TABLE
()
class
Splitter
:
public
wxSplitterWindow
{
public:
Splitter
(
wxWindow
*
p_parent
,
intf_thread_t
*
_p_intf
)
:
wxSplitterWindow
(
p_parent
,
-
1
,
wxDefaultPosition
,
wxSize
(
0
,
0
),
wxCLIP_CHILDREN
|
wxSP_3DSASH
),
p_intf
(
_p_intf
),
i_sash_position
(
150
)
{}
virtual
~
Splitter
()
{};
virtual
bool
Split
(
wxWindow
*
window1
,
wxWindow
*
window2
)
{
return
wxSplitterWindow
::
SplitHorizontally
(
window1
,
window2
,
-
i_sash_position
);
}
private:
DECLARE_EVENT_TABLE
()
void
OnSize
(
wxSizeEvent
&
event
)
{
SetSashPosition
(
event
.
GetSize
().
GetHeight
()
-
i_sash_position
);
event
.
Skip
();
}
void
OnSashPosChanged
(
wxSplitterEvent
&
event
)
{
if
(
!
GetSize
().
GetHeight
()
){
event
.
Skip
();
return
;
}
i_sash_position
=
GetSize
().
GetHeight
()
-
event
.
GetSashPosition
();
event
.
Skip
();
}
intf_thread_t
*
p_intf
;
int
i_sash_position
;
};
BEGIN_EVENT_TABLE
(
Splitter
,
wxSplitterWindow
)
EVT_SIZE
(
Splitter
::
OnSize
)
EVT_SPLITTER_SASH_POS_CHANGED
(
-
1
,
Splitter
::
OnSashPosChanged
)
END_EVENT_TABLE
()
/*****************************************************************************
* Event Table.
*****************************************************************************/
...
...
@@ -228,8 +270,7 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
/* Create a splitter window that will fill in the interface window.
* We need a splitter bar in order to make the embedded playlist
* resizable. */
splitter
=
new
wxSplitterWindow
(
this
,
-
1
,
wxDefaultPosition
,
wxSize
(
0
,
0
),
wxCLIP_CHILDREN
|
wxSP_3DSASH
);
splitter
=
new
Splitter
(
this
,
p_intf
);
main_sizer
=
new
wxBoxSizer
(
wxVERTICAL
);
main_sizer
->
Add
(
splitter
,
1
,
wxEXPAND
);
SetSizer
(
main_sizer
);
...
...
@@ -252,9 +293,6 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
/* Put this in the splitter */
splitter
->
Initialize
(
main_panel
);
#if wxCHECK_VERSION(2,6,0)
splitter
->
SetSashGravity
(
1.0
);
#endif
#ifdef wxHAS_TASK_BAR_ICON
/* Systray integration */
...
...
@@ -878,11 +916,8 @@ void Interface::OnSmallPlaylist( wxCommandEvent& WXUNUSED(event) )
b_playlist_manager
=
!
b_playlist_manager
;
if
(
b_playlist_manager
)
splitter
->
SplitHorizontally
(
main_panel
,
playlist_manager
,
-
playlist_min_size
.
GetHeight
()
);
else
splitter
->
Unsplit
(
playlist_manager
);
if
(
b_playlist_manager
)
splitter
->
Split
(
main_panel
,
playlist_manager
);
else
splitter
->
Unsplit
(
playlist_manager
);
SetIntfMinSize
();
main_sizer
->
Layout
();
...
...
modules/gui/wxwidgets/interface.hpp
View file @
98a42ae0
...
...
@@ -30,8 +30,8 @@
#include <wx/dnd.h>
#include <wx/accel.h>
#include <wx/taskbar.h>
#include <wx/splitter.h>
class
Splitter
;
namespace
wxvlc
{
...
...
@@ -93,7 +93,7 @@ namespace wxvlc
void
NextStream
();
wxBoxSizer
*
main_sizer
;
wxSplitterWindow
*
splitter
;
Splitter
*
splitter
;
wxPanel
*
main_panel
;
wxBoxSizer
*
panel_sizer
;
...
...
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