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
761bddc9
Commit
761bddc9
authored
Jul 18, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/prefs widgets: fix rendering
parent
50764eac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
137 additions
and
141 deletions
+137
-141
modules/gui/macosx/prefs_widgets.m
modules/gui/macosx/prefs_widgets.m
+137
-141
No files found.
modules/gui/macosx/prefs_widgets.m
View file @
761bddc9
...
...
@@ -414,12 +414,6 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
return
(
self
);
}
-
(
id
)
initWithItem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_view
;
{
return
nil
;
// implemented by children only
}
-
(
void
)
setYPos
:(
int
)
i_yPos
{
NSRect
frame
=
[
self
frame
];
...
...
@@ -770,84 +764,84 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
}
+
(
VLCConfigControl
*
)
newControl
:(
module_config_t
*
)
_p_item
withView
:(
NSView
*
)
o_parent_v
iew
withView
:(
NSView
*
)
parentV
iew
{
VLCConfigControl
*
p_
control
=
NULL
;
VLCConfigControl
*
control
=
NULL
;
switch
(
_p_item
->
i_type
)
{
case
CONFIG_ITEM_STRING
:
case
CONFIG_ITEM_PASSWORD
:
if
(
!
_p_item
->
list_count
)
{
p_
control
=
[[
StringConfigControl
alloc
]
control
=
[[
StringConfigControl
alloc
]
initWithItem:
_p_item
withView:
o_parent_v
iew
];
withView:
parentV
iew
];
}
else
{
p_
control
=
[[
StringListConfigControl
alloc
]
control
=
[[
StringListConfigControl
alloc
]
initWithItem:
_p_item
withView:
o_parent_v
iew
];
withView:
parentV
iew
];
}
break
;
case
CONFIG_ITEM_LOADFILE
:
case
CONFIG_ITEM_SAVEFILE
:
case
CONFIG_ITEM_DIRECTORY
:
p_
control
=
[[
FileConfigControl
alloc
]
control
=
[[
FileConfigControl
alloc
]
initWithItem:
_p_item
withView:
o_parent_v
iew
];
withView:
parentV
iew
];
break
;
case
CONFIG_ITEM_MODULE
:
p_
control
=
[[
StringListConfigControl
alloc
]
control
=
[[
StringListConfigControl
alloc
]
initWithItem:
_p_item
withView:
o_parent_v
iew
];
withView:
parentV
iew
];
break
;
case
CONFIG_ITEM_MODULE_CAT
:
p_
control
=
[[
ModuleConfigControl
alloc
]
control
=
[[
ModuleConfigControl
alloc
]
initWithItem:
_p_item
withView:
o_parent_v
iew
];
withView:
parentV
iew
];
break
;
case
CONFIG_ITEM_INTEGER
:
if
(
_p_item
->
list_count
)
p_control
=
[[
IntegerListConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
o_parent_v
iew
];
control
=
[[
IntegerListConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
parentV
iew
];
else
if
((
_p_item
->
min
.
i
!=
0
||
_p_item
->
max
.
i
!=
0
)
&&
(
_p_item
->
min
.
i
!=
INT_MIN
||
_p_item
->
max
.
i
!=
INT_MAX
))
p_control
=
[[
RangedIntegerConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
o_parent_v
iew
];
control
=
[[
RangedIntegerConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
parentV
iew
];
else
p_control
=
[[
IntegerConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
o_parent_v
iew
];
control
=
[[
IntegerConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
parentV
iew
];
break
;
case
CONFIG_ITEM_BOOL
:
p_control
=
[[
BoolConfigControl
alloc
]
initWithItem:
_p_item
withView:
o_parent_view
];
control
=
[[
BoolConfigControl
alloc
]
initWithItem
:
_p_item
withView:
parentView
];
break
;
case
CONFIG_ITEM_FLOAT
:
if
((
_p_item
->
min
.
i
!=
0
||
_p_item
->
max
.
i
!=
0
)
&&
(
_p_item
->
min
.
i
!=
INT_MIN
||
_p_item
->
max
.
i
!=
INT_MAX
))
p_control
=
[[
RangedFloatConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
o_parent_v
iew
];
control
=
[[
RangedFloatConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
parentV
iew
];
else
p_control
=
[[
FloatConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
o_parent_v
iew
];
control
=
[[
FloatConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
parentV
iew
];
break
;
/* don't display keys in the advanced settings, since the current controls
are broken by design. The user is required to change hotkeys in the sprefs
and can only change really advanced stuff here..
case CONFIG_ITEM_KEY:
p_
control = [[KeyConfigControl alloc]
control = [[KeyConfigControl alloc]
initWithItem: _p_item
withView:
o_parent_v
iew];
withView:
parentV
iew];
break; */
case
CONFIG_ITEM_MODULE_LIST
:
case
CONFIG_ITEM_MODULE_LIST_CAT
:
p_control
=
[[
ModuleListConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
o_parent_v
iew
];
control
=
[[
ModuleListConfigControl
alloc
]
initWithItem
:
_p_item
withView
:
parentV
iew
];
break
;
case
CONFIG_SECTION
:
p_control
=
[[
SectionControl
alloc
]
initWithItem
:
_p_item
withView
:
o_parent_v
iew
];
control
=
[[
SectionControl
alloc
]
initWithItem
:
_p_item
withView
:
parentV
iew
];
break
;
default:
break
;
}
return
p_control
;
return
control
;
}
-
(
NSString
*
)
name
...
...
@@ -924,11 +918,11 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@end
@implementation
StringConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_
labelString
,
*
o_textfieldString
,
*
o_textfieldTooltip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
o_textfieldString
,
*
o_textfieldTooltip
;
mainFrame
.
size
.
height
=
22
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
...
...
@@ -944,10 +938,10 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
o_
labelString
,
o_textfieldTooltip
)
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
labelString
,
o_textfieldTooltip
)
[
self
.
label
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
self
.
label
];
...
...
@@ -1011,11 +1005,11 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@end
@implementation
StringListConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_
labelString
,
*
o_textfieldTooltip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
o_textfieldTooltip
;
mainFrame
.
size
.
height
=
22
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
+
1
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
...
...
@@ -1031,10 +1025,10 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
o_
labelString
,
o_textfieldTooltip
)
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
labelString
,
o_textfieldTooltip
)
[
self
.
label
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
self
.
label
];
...
...
@@ -1115,11 +1109,11 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@end
@implementation
FileConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_
labelString
,
*
o_itemTooltip
,
*
o_textfieldString
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
o_itemTooltip
,
*
o_textfieldString
;
mainFrame
.
size
.
height
=
46
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
...
...
@@ -1135,10 +1129,10 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
3
,
o_
labelString
,
o_itemTooltip
)
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
3
,
labelString
,
o_itemTooltip
)
[
self
.
label
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
self
.
label
];
...
...
@@ -1214,11 +1208,11 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@end
@implementation
ModuleConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_
labelString
,
*
o_popupTooltip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
o_popupTooltip
;
mainFrame
.
size
.
height
=
22
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
+
1
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
...
...
@@ -1231,11 +1225,11 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
1
,
o_
labelString
,
o_popupTooltip
)
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
1
,
labelString
,
o_popupTooltip
)
[
self
.
label
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
self
.
label
];
...
...
@@ -1349,11 +1343,11 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@end
@implementation
IntegerConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_labelString
,
*
o_toolt
ip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
toolT
ip
;
mainFrame
.
size
.
height
=
23
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
+
1
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
...
...
@@ -1362,26 +1356,26 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
if
([
super
initWithFrame
:
mainFrame
item
:
p_item
]
!=
nil
)
{
self
.
viewType
=
CONFIG_ITEM_INTEGER
;
o_toolt
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
toolT
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
o_labelString
,
o_toolt
ip
)
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
labelString
,
toolT
ip
)
[
self
.
label
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
self
.
label
];
/* build the stepper */
ADD_STEPPER
(
o_stepper
,
mainFrame
,
mainFrame
.
size
.
width
-
19
,
0
,
o_toolt
ip
,
-
100000
,
100000
)
0
,
toolT
ip
,
-
100000
,
100000
)
[
o_stepper
setIntValue
:
p_item
->
value
.
i
];
[
o_stepper
setAutoresizingMask
:
NSViewMaxXMargin
];
[
self
addSubview
:
o_stepper
];
ADD_TEXTFIELD
(
o_textfield
,
mainFrame
,
mainFrame
.
size
.
width
-
19
-
52
,
1
,
49
,
o_toolt
ip
,
@""
)
1
,
49
,
toolT
ip
,
@""
)
[
o_textfield
setIntValue
:
p_item
->
value
.
i
];
[
o_textfield
setDelegate
:
self
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
...
...
@@ -1441,11 +1435,11 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@implementation
IntegerListConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_
labelString
,
*
o_textfieldTooltip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
o_textfieldTooltip
;
mainFrame
.
size
.
height
=
22
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
+
1
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
...
...
@@ -1458,10 +1452,10 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
o_
labelString
,
o_textfieldTooltip
)
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
labelString
,
o_textfieldTooltip
)
[
self
.
label
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
self
.
label
];
...
...
@@ -1534,11 +1528,11 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@end
@implementation
RangedIntegerConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_labelString
,
*
o_toolt
ip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
toolT
ip
;
mainFrame
.
size
.
height
=
50
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
...
...
@@ -1547,20 +1541,20 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
if
([
super
initWithFrame
:
mainFrame
item
:
p_item
]
!=
nil
)
{
self
.
viewType
=
CONFIG_ITEM_RANGED_INTEGER
;
o_toolt
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
toolT
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
o_labelString
,
o_toolt
ip
)
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
labelString
,
toolT
ip
)
[
self
.
label
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
self
.
label
];
/* build the textfield */
ADD_TEXTFIELD
(
o_textfield
,
mainFrame
,
[
self
.
label
frame
].
size
.
width
+
2
,
28
,
49
,
o_toolt
ip
,
@""
)
28
,
49
,
toolT
ip
,
@""
)
[
o_textfield
setIntValue
:
p_item
->
value
.
i
];
[
o_textfield
setAutoresizingMask
:
NSViewMaxXMargin
];
[
o_textfield
setDelegate
:
self
];
...
...
@@ -1589,7 +1583,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
[
o_textfield_min
frame
].
size
.
width
+
6
,
-
1
,
mainFrame
.
size
.
width
-
[
o_textfield_max
frame
].
size
.
width
-
[
o_textfield_max
frame
].
size
.
width
-
14
-
[
o_textfield_min
frame
].
origin
.
x
,
o_toolt
ip
,
[
o_textfield_min
frame
].
origin
.
x
,
toolT
ip
,
p_item
->
min
.
i
,
p_item
->
max
.
i
)
[
o_slider
setIntValue
:
p_item
->
value
.
i
];
[
o_slider
setAutoresizingMask
:
NSViewWidthSizable
];
...
...
@@ -1647,11 +1641,11 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@end
@implementation
FloatConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_labelString
,
*
o_toolt
ip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
toolT
ip
;
mainFrame
.
size
.
height
=
23
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
+
1
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
...
...
@@ -1660,27 +1654,27 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
if
([
super
initWithFrame
:
mainFrame
item
:
p_item
]
!=
nil
)
{
self
.
viewType
=
CONFIG_ITEM_INTEGER
;
o_toolt
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
toolT
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
2
,
o_labelString
,
o_toolt
ip
)
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
2
,
labelString
,
toolT
ip
)
[
self
.
label
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
self
.
label
];
/* build the stepper */
ADD_STEPPER
(
o_stepper
,
mainFrame
,
mainFrame
.
size
.
width
-
19
,
0
,
o_toolt
ip
,
-
100000
,
100000
)
0
,
toolT
ip
,
-
100000
,
100000
)
[
o_stepper
setFloatValue
:
p_item
->
value
.
f
];
[
o_stepper
setAutoresizingMask
:
NSViewMaxXMargin
];
[
self
addSubview
:
o_stepper
];
/* build the textfield */
ADD_TEXTFIELD
(
o_textfield
,
mainFrame
,
mainFrame
.
size
.
width
-
19
-
52
,
1
,
49
,
o_toolt
ip
,
@""
)
1
,
49
,
toolT
ip
,
@""
)
[
o_textfield
setFloatValue
:
p_item
->
value
.
f
];
[
o_textfield
setDelegate
:
self
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
...
...
@@ -1741,11 +1735,11 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@end
@implementation
RangedFloatConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_labelString
,
*
o_toolt
ip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
toolT
ip
;
mainFrame
.
size
.
height
=
50
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
...
...
@@ -1754,20 +1748,20 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
if
([
super
initWithFrame
:
mainFrame
item
:
p_item
]
!=
nil
)
{
self
.
viewType
=
CONFIG_ITEM_RANGED_INTEGER
;
o_toolt
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
toolT
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
o_labelString
,
o_toolt
ip
)
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
labelString
,
toolT
ip
)
[
self
.
label
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
self
.
label
];
/* build the textfield */
ADD_TEXTFIELD
(
o_textfield
,
mainFrame
,
[
self
.
label
frame
].
size
.
width
+
2
,
28
,
49
,
o_toolt
ip
,
@""
)
28
,
49
,
toolT
ip
,
@""
)
[
o_textfield
setFloatValue
:
p_item
->
value
.
f
];
[
o_textfield
setAutoresizingMask
:
NSViewMaxXMargin
];
[
o_textfield
setDelegate
:
self
];
...
...
@@ -1796,7 +1790,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
[
o_textfield_min
frame
].
size
.
width
+
6
,
-
1
,
mainFrame
.
size
.
width
-
[
o_textfield_max
frame
].
size
.
width
-
[
o_textfield_max
frame
].
size
.
width
-
14
-
[
o_textfield_min
frame
].
origin
.
x
,
o_toolt
ip
,
p_item
->
min
.
f
,
[
o_textfield_min
frame
].
origin
.
x
,
toolT
ip
,
p_item
->
min
.
f
,
p_item
->
max
.
f
)
[
o_slider
setFloatValue
:
p_item
->
value
.
f
];
[
o_slider
setAutoresizingMask
:
NSViewWidthSizable
];
...
...
@@ -1853,30 +1847,32 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@implementation
BoolConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_labelString
,
*
o_toolt
ip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
toolT
ip
;
mainFrame
.
size
.
height
=
17
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
mainFrame
.
origin
.
y
=
0
;
if
([
super
initWithFrame
:
mainFrame
item
:
p_item
]
!=
nil
)
{
self
=
[
super
initWithFrame
:
mainFrame
item
:
p_item
];
if
(
self
!=
nil
)
{
self
.
viewType
=
CONFIG_ITEM_BOOL
;
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
labelString
=
@""
;
o_toolt
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
toolT
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
/* add the checkbox */
ADD_CHECKBOX
(
o_checkbox
,
mainFrame
,
0
,
0
,
o_labelString
,
o_toolt
ip
,
p_item
->
value
.
i
,
NSImageLeft
)
[
o_checkbox
setAutoresizingMask
:
NSViewNotSizable
];
0
,
labelString
,
toolT
ip
,
p_item
->
value
.
i
,
NSImageLeft
)
[
o_checkbox
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
o_checkbox
];
}
return
self
;
...
...
@@ -1901,11 +1897,11 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@end
@implementation
KeyConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_labelString
,
*
o_toolt
ip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
toolT
ip
;
mainFrame
.
size
.
height
=
22
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
+
1
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
...
...
@@ -1914,21 +1910,21 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
if
([
super
initWithFrame
:
mainFrame
item
:
p_item
]
!=
nil
)
{
self
.
viewType
=
CONFIG_ITEM_KEY
;
o_toolt
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
toolT
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
1
,
o_labelString
,
o_toolt
ip
)
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
1
,
labelString
,
toolT
ip
)
[
self
.
label
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
self
.
label
];
/* build the popup */
ADD_POPUP
(
o_popup
,
mainFrame
,
[
self
.
label
frame
].
origin
.
x
+
[
self
.
label
frame
].
size
.
width
+
3
,
-
2
,
0
,
o_toolt
ip
)
-
2
,
0
,
toolT
ip
)
[
o_popup
setAutoresizingMask
:
NSViewWidthSizable
];
if
(
o_keys_menu
==
nil
)
{
...
...
@@ -1986,16 +1982,16 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
@end
@implementation
ModuleListConfigControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
BOOL
b_by_cat
=
p_item
->
i_type
==
CONFIG_ITEM_MODULE_LIST_CAT
;
//Fill our array to know how may items we have...
module_t
*
p_parser
,
**
p_list
;
size_t
i_module_index
;
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_labelString
,
*
o_textfieldString
,
*
o_toolt
ip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
o_textfieldString
,
*
toolT
ip
;
o_modulearray
=
[[
NSMutableArray
alloc
]
initWithCapacity
:
10
];
/* build a list of available modules */
...
...
@@ -2132,14 +2128,14 @@ o_moduleenabled = [NSNumber numberWithBool:NO];\
if
([
super
initWithFrame
:
mainFrame
item
:
p_item
]
!=
nil
)
{
self
.
viewType
=
CONFIG_ITEM_MODULE_LIST
;
o_toolt
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
toolT
ip
=
[[
VLCStringUtility
sharedInstance
]
wrapString
:
_NS
((
char
*
)
p_item
->
psz_longtext
)
toWidth
:
PREFS_WRAP
];
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
o_labelString
,
o_toolt
ip
)
labelString
=
@""
;
ADD_LABEL
(
self
.
label
,
mainFrame
,
0
,
-
3
,
labelString
,
toolT
ip
)
[
self
.
label
setAutoresizingMask
:
NSViewNotSizable
];
[
self
addSubview
:
self
.
label
];
...
...
@@ -2150,7 +2146,7 @@ o_moduleenabled = [NSNumber numberWithBool:NO];\
o_textfieldString
=
@""
;
ADD_TEXTFIELD
(
o_textfield
,
mainFrame
,
[
self
.
label
frame
].
size
.
width
+
2
,
mainFrame
.
size
.
height
-
22
,
mainFrame
.
size
.
width
-
[
self
.
label
frame
].
size
.
width
-
2
,
o_toolt
ip
,
o_textfieldString
)
[
self
.
label
frame
].
size
.
width
-
2
,
toolT
ip
,
o_textfieldString
)
[
o_textfield
setAutoresizingMask
:
NSViewWidthSizable
];
[
self
addSubview
:
o_textfield
];
...
...
@@ -2308,11 +2304,11 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
@implementation
SectionControl
-
(
id
)
initWith
i
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
o_parent_v
iew
-
(
id
)
initWith
I
tem
:(
module_config_t
*
)
p_item
withView
:(
NSView
*
)
parentV
iew
{
NSRect
mainFrame
=
[
o_parent_v
iew
frame
];
NSString
*
o_labelString
,
*
o_toolt
ip
;
NSRect
mainFrame
=
[
parentV
iew
frame
];
NSString
*
labelString
,
*
toolT
ip
;
mainFrame
.
size
.
height
=
17
;
mainFrame
.
size
.
width
=
mainFrame
.
size
.
width
-
LEFTMARGIN
-
RIGHTMARGIN
;
mainFrame
.
origin
.
x
=
LEFTMARGIN
;
...
...
@@ -2321,15 +2317,15 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
if
([
super
initWithFrame
:
mainFrame
item
:
p_item
]
!=
nil
)
{
/* add the label */
if
(
p_item
->
psz_text
)
o_
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
labelString
=
_NS
((
char
*
)
p_item
->
psz_text
);
else
o_
labelString
=
@""
;
labelString
=
@""
;
NSDictionary
*
boldAttributes
=
[
NSDictionary
dictionaryWithObjectsAndKeys
:
[
NSFont
boldSystemFontOfSize
:[
NSFont
systemFontSize
]],
NSFontAttributeName
,
nil
];
NSAttributedString
*
o_bold_string
=
[[
NSAttributedString
alloc
]
initWithString
:
o_
labelString
attributes
:
boldAttributes
];
NSAttributedString
*
o_bold_string
=
[[
NSAttributedString
alloc
]
initWithString
:
labelString
attributes
:
boldAttributes
];
ADD_LABEL
(
self
.
label
,
mainFrame
,
1
,
0
,
@""
,
@""
)
[
self
.
label
setAttributedStringValue
:
o_bold_string
];
...
...
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