Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
095c755b
Commit
095c755b
authored
Apr 12, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/gui/wxwindows/*: improved preferences widgets a bit.
parent
55837a58
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
17 deletions
+59
-17
modules/gui/wxwindows/open.cpp
modules/gui/wxwindows/open.cpp
+11
-6
modules/gui/wxwindows/preferences_widgets.cpp
modules/gui/wxwindows/preferences_widgets.cpp
+37
-10
modules/gui/wxwindows/preferences_widgets.h
modules/gui/wxwindows/preferences_widgets.h
+11
-1
No files found.
modules/gui/wxwindows/open.cpp
View file @
095c755b
...
...
@@ -4,7 +4,7 @@
* Copyright (C) 2000-2004 VideoLAN
* $Id$
*
* Authors: Gildas Bazin <gbazin@
netcourrier.com
>
* Authors: Gildas Bazin <gbazin@
videolan.org
>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -849,7 +849,13 @@ void OpenDialog::UpdateMRL( int i_access_method )
for
(
int
i
=
0
;
i
<
(
int
)
input_panel
->
config_array
.
GetCount
();
i
++
)
{
ConfigControl
*
control
=
input_panel
->
config_array
.
Item
(
i
);
mrltemp
+=
wxT
(
" :"
)
+
control
->
GetName
()
+
wxT
(
"="
);
mrltemp
+=
wxT
(
" :"
);
if
(
control
->
GetType
()
==
CONFIG_ITEM_BOOL
&&
!
control
->
GetIntValue
()
)
mrltemp
+=
wxT
(
"no-"
);
mrltemp
+=
control
->
GetName
();
switch
(
control
->
GetType
()
)
{
...
...
@@ -857,16 +863,15 @@ void OpenDialog::UpdateMRL( int i_access_method )
case
CONFIG_ITEM_FILE
:
case
CONFIG_ITEM_DIRECTORY
:
case
CONFIG_ITEM_MODULE
:
mrltemp
+=
wxT
(
"
\"
"
)
+
control
->
GetPszValue
()
+
wxT
(
"
\"
"
);
mrltemp
+=
wxT
(
"
=
\"
"
)
+
control
->
GetPszValue
()
+
wxT
(
"
\"
"
);
break
;
case
CONFIG_ITEM_INTEGER
:
case
CONFIG_ITEM_BOOL
:
mrltemp
+=
wxString
::
Format
(
wxT
(
"%i"
),
control
->
GetIntValue
()
);
wxString
::
Format
(
wxT
(
"
=
%i"
),
control
->
GetIntValue
()
);
break
;
case
CONFIG_ITEM_FLOAT
:
mrltemp
+=
wxString
::
Format
(
wxT
(
"
%f"
),
control
->
GetFloatValue
());
wxString
::
Format
(
wxT
(
"=
%f"
),
control
->
GetFloatValue
());
break
;
}
}
...
...
modules/gui/wxwindows/preferences_widgets.cpp
View file @
095c755b
...
...
@@ -4,7 +4,7 @@
* Copyright (C) 2000-2004 VideoLAN
* $Id$
*
* Authors: Gildas Bazin <gbazin@
netcourrier.com
>
* Authors: Gildas Bazin <gbazin@
videolan.org
>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -335,6 +335,9 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *p_this,
wxWindow
*
parent
)
:
ConfigControl
(
p_this
,
p_item
,
parent
)
{
psz_default_value
=
p_item
->
psz_value
;
if
(
psz_default_value
)
psz_default_value
=
strdup
(
psz_default_value
);
label
=
new
wxStaticText
(
this
,
-
1
,
wxU
(
p_item
->
psz_text
));
sizer
->
Add
(
label
,
1
,
wxALIGN_CENTER_VERTICAL
|
wxALL
,
5
);
combo
=
new
wxComboBox
(
this
,
-
1
,
wxT
(
""
),
...
...
@@ -359,12 +362,16 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *p_this,
StringListConfigControl
::~
StringListConfigControl
()
{
if
(
psz_default_value
)
free
(
psz_default_value
);
}
void
StringListConfigControl
::
UpdateCombo
(
module_config_t
*
p_item
)
{
vlc_bool_t
b_found
=
VLC_FALSE
;
int
i_index
;
/* build a list of available options */
for
(
i
nt
i
_index
=
0
;
i_index
<
p_item
->
i_list
;
i_index
++
)
for
(
i_index
=
0
;
i_index
<
p_item
->
i_list
;
i_index
++
)
{
combo
->
Append
(
(
p_item
->
ppsz_list_text
&&
p_item
->
ppsz_list_text
[
i_index
]
)
?
...
...
@@ -380,8 +387,18 @@ void StringListConfigControl::UpdateCombo( module_config_t *p_item )
p_item
->
ppsz_list_text
[
i_index
]
)
?
wxU
(
p_item
->
ppsz_list_text
[
i_index
])
:
wxL2U
(
p_item
->
ppsz_list
[
i_index
])
);
b_found
=
VLC_TRUE
;
}
}
if
(
p_item
->
psz_value
&&
!
b_found
)
{
/* Add custom entry to list */
combo
->
Append
(
wxL2U
(
p_item
->
psz_value
)
);
combo
->
SetClientData
(
i_index
,
(
void
*
)
psz_default_value
);
combo
->
SetSelection
(
i_index
);
combo
->
SetValue
(
wxL2U
(
p_item
->
psz_value
)
);
}
}
BEGIN_EVENT_TABLE
(
StringListConfigControl
,
wxPanel
)
...
...
@@ -494,6 +511,10 @@ wxString FileConfigControl::GetPszValue()
/*****************************************************************************
* IntegerConfigControl implementation
*****************************************************************************/
BEGIN_EVENT_TABLE
(
IntegerConfigControl
,
wxPanel
)
EVT_COMMAND_SCROLL
(
-
1
,
IntegerConfigControl
::
OnUpdate
)
END_EVENT_TABLE
()
IntegerConfigControl
::
IntegerConfigControl
(
vlc_object_t
*
p_this
,
module_config_t
*
p_item
,
wxWindow
*
parent
)
...
...
@@ -621,6 +642,10 @@ int IntegerListConfigControl::GetIntValue()
/*****************************************************************************
* RangedIntConfigControl implementation
*****************************************************************************/
BEGIN_EVENT_TABLE
(
RangedIntConfigControl
,
wxPanel
)
EVT_COMMAND_SCROLL
(
-
1
,
RangedIntConfigControl
::
OnUpdate
)
END_EVENT_TABLE
()
RangedIntConfigControl
::
RangedIntConfigControl
(
vlc_object_t
*
p_this
,
module_config_t
*
p_item
,
wxWindow
*
parent
)
...
...
@@ -650,6 +675,10 @@ int RangedIntConfigControl::GetIntValue()
/*****************************************************************************
* FloatConfigControl implementation
*****************************************************************************/
BEGIN_EVENT_TABLE
(
FloatConfigControl
,
wxPanel
)
EVT_TEXT
(
-
1
,
FloatConfigControl
::
OnUpdate
)
END_EVENT_TABLE
()
FloatConfigControl
::
FloatConfigControl
(
vlc_object_t
*
p_this
,
module_config_t
*
p_item
,
wxWindow
*
parent
)
...
...
@@ -684,6 +713,10 @@ float FloatConfigControl::GetFloatValue()
/*****************************************************************************
* BoolConfigControl implementation
*****************************************************************************/
BEGIN_EVENT_TABLE
(
BoolConfigControl
,
wxPanel
)
EVT_CHECKBOX
(
-
1
,
BoolConfigControl
::
OnUpdate
)
END_EVENT_TABLE
()
BoolConfigControl
::
BoolConfigControl
(
vlc_object_t
*
p_this
,
module_config_t
*
p_item
,
wxWindow
*
parent
)
...
...
@@ -704,12 +737,6 @@ BoolConfigControl::~BoolConfigControl()
int
BoolConfigControl
::
GetIntValue
()
{
if
(
checkbox
->
IsChecked
()
)
{
return
1
;
}
else
{
return
0
;
}
if
(
checkbox
->
IsChecked
()
)
return
1
;
else
return
0
;
}
modules/gui/wxwindows/preferences_widgets.h
View file @
095c755b
...
...
@@ -102,6 +102,7 @@ public:
virtual
wxString
GetPszValue
();
private:
wxComboBox
*
combo
;
char
*
psz_default_value
;
void
UpdateCombo
(
module_config_t
*
p_item
);
void
OnAction
(
wxCommandEvent
&
);
...
...
@@ -117,10 +118,11 @@ public:
void
OnBrowse
(
wxCommandEvent
&
);
virtual
wxString
GetPszValue
();
private:
DECLARE_EVENT_TABLE
()
wxTextCtrl
*
textctrl
;
wxButton
*
browse
;
bool
directory
;
DECLARE_EVENT_TABLE
()
};
class
IntegerConfigControl
:
public
ConfigControl
...
...
@@ -131,6 +133,8 @@ public:
virtual
int
GetIntValue
();
private:
wxSpinCtrl
*
spin
;
DECLARE_EVENT_TABLE
()
};
class
IntegerListConfigControl
:
public
ConfigControl
...
...
@@ -156,6 +160,8 @@ public:
virtual
int
GetIntValue
();
private:
wxSlider
*
slider
;
DECLARE_EVENT_TABLE
()
};
class
FloatConfigControl
:
public
ConfigControl
...
...
@@ -166,6 +172,8 @@ public:
virtual
float
GetFloatValue
();
private:
wxTextCtrl
*
textctrl
;
DECLARE_EVENT_TABLE
()
};
class
BoolConfigControl
:
public
ConfigControl
...
...
@@ -176,4 +184,6 @@ public:
virtual
int
GetIntValue
();
private:
wxCheckBox
*
checkbox
;
DECLARE_EVENT_TABLE
()
};
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