Commit b3c41d79 authored by Olivier Teulière's avatar Olivier Teulière

The win32 interface is preparing for the internationalization.

parent 5e1d56ae
......@@ -6,7 +6,7 @@ win32_CUSTOM = yes
win32.so: Makefile
rm -f win32.mak
$(BCBUILDER)/Bin/bpr2mak win32.bpr -s | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -D__PLUGIN__ -D__VLC__ -DMODULE_NAME_IS_win32 -DMODULE_NAME=win32 -DMODULE_PATH=modules_gui_win32_win32#' > win32.mak
$(BCBUILDER)/Bin/bpr2mak win32.bpr -s | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DMODULE_NAME=win32 -DMODULE_PATH=modules_gui_win32_win32#' > win32.mak
$(BCBUILDER)/Bin/make -f win32.mak -b
......@@ -27,6 +27,7 @@
#include <vlc/intf.h>
#include "about.h"
#include "misc.h"
#include "win32_common.h"
//---------------------------------------------------------------------------
......@@ -41,7 +42,7 @@ __fastcall TAboutDlg::TAboutDlg( TComponent* Owner )
{
Image1->Picture->Icon = p_intfGlobal->p_sys->p_window->Icon;
LabelVersion->Caption = "Version " VERSION;
Translate( this );
}
//---------------------------------------------------------------------------
......@@ -246,6 +246,7 @@ object AboutDlg: TAboutDlg
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Tag = 3
Left = 114
Top = 18
Width = 132
......@@ -259,6 +260,7 @@ object AboutDlg: TAboutDlg
ParentFont = False
end
object Label2: TLabel
Tag = 3
Left = 10
Top = 64
Width = 267
......@@ -266,6 +268,7 @@ object AboutDlg: TAboutDlg
Caption = '(C) Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002'
end
object Label4: TLabel
Tag = 3
Left = 15
Top = 123
Width = 253
......@@ -277,6 +280,7 @@ object AboutDlg: TAboutDlg
WordWrap = True
end
object Label3: TLabel
Tag = 3
Left = 30
Top = 80
Width = 227
......@@ -290,6 +294,7 @@ object AboutDlg: TAboutDlg
Height = 49
end
object Label5: TLabel
Tag = 3
Left = 83
Top = 96
Width = 121
......@@ -297,6 +302,7 @@ object AboutDlg: TAboutDlg
Caption = 'http://www.videolan.org/'
end
object LabelVersion: TLabel
Tag = 3
Left = 114
Top = 40
Width = 59
......@@ -304,6 +310,7 @@ object AboutDlg: TAboutDlg
Caption = 'Version x.y.z'
end
object BitBtnOk: TBitBtn
Tag = 3
Left = 64
Top = 178
Width = 145
......
......@@ -27,6 +27,7 @@
#include <vlc/intf.h>
#include "disc.h"
#include "misc.h";
#include "win32_common.h"
//---------------------------------------------------------------------------
......@@ -42,6 +43,7 @@ __fastcall TDiscDlg::TDiscDlg( TComponent* Owner )
{
/* Simulate a click to get the correct device name */
RadioGroupTypeClick( RadioGroupType );
Translate( this );
}
//---------------------------------------------------------------------------
void __fastcall TDiscDlg::FormShow( TObject *Sender )
......
......@@ -248,6 +248,7 @@ object DiscDlg: TDiscDlg
PixelsPerInch = 96
TextHeight = 13
object LabelDevice: TLabel
Tag = 3
Left = 8
Top = 105
Width = 63
......@@ -255,6 +256,7 @@ object DiscDlg: TDiscDlg
Caption = 'Device name'
end
object GroupBoxPosition: TGroupBox
Tag = 3
Left = 96
Top = 8
Width = 153
......@@ -262,6 +264,7 @@ object DiscDlg: TDiscDlg
Caption = 'Starting position'
TabOrder = 1
object LabelTitle: TLabel
Tag = 3
Left = 16
Top = 24
Width = 20
......@@ -269,6 +272,7 @@ object DiscDlg: TDiscDlg
Caption = 'Title'
end
object LabelChapter: TLabel
Tag = 3
Left = 16
Top = 52
Width = 37
......@@ -301,6 +305,7 @@ object DiscDlg: TDiscDlg
end
end
object RadioGroupType: TRadioGroup
Tag = 3
Left = 8
Top = 8
Width = 81
......@@ -314,6 +319,7 @@ object DiscDlg: TDiscDlg
OnClick = RadioGroupTypeClick
end
object BitBtnOk: TBitBtn
Tag = 3
Left = 8
Top = 136
Width = 113
......@@ -325,6 +331,7 @@ object DiscDlg: TDiscDlg
OnClick = BitBtnOkClick
end
object BitBtnCancel: TBitBtn
Tag = 3
Left = 136
Top = 136
Width = 113
......@@ -335,6 +342,7 @@ object DiscDlg: TDiscDlg
OnClick = BitBtnCancelClick
end
object EditDevice: TEdit
Tag = 5
Left = 88
Top = 101
Width = 161
......
......@@ -36,6 +36,7 @@
#include "preferences.h"
#include "messages.h"
#include "playlist.h"
#include "misc.h"
#include "win32_common.h"
#include "netutils.h"
......@@ -64,6 +65,8 @@ __fastcall TMainFrameDlg::TMainFrameDlg( TComponent* Owner )
Caption = VOUT_TITLE " (Win32 interface)";
StringListPref = new TStringList();
Translate( this );
}
//---------------------------------------------------------------------------
__fastcall TMainFrameDlg::~TMainFrameDlg()
......
This diff is collapsed.
......@@ -178,15 +178,15 @@ __published: // IDE-managed Components
void __fastcall StopActionExecute( TObject *Sender );
void __fastcall SlowActionExecute( TObject *Sender );
void __fastcall FastActionExecute( TObject *Sender );
void __fastcall EjectActionExecute( TObject *Sender );
void __fastcall PlaylistActionExecute( TObject *Sender );
void __fastcall ExitActionExecute( TObject *Sender );
void __fastcall PreviousActionExecute( TObject *Sender );
void __fastcall NextActionExecute( TObject *Sender );
void __fastcall FullscreenActionExecute( TObject *Sender );
void __fastcall PreferencesActionExecute( TObject *Sender );
void __fastcall MessagesActionExecute( TObject *Sender );
void __fastcall AboutActionExecute( TObject *Sender );
void __fastcall EjectActionExecute( TObject *Sender );
void __fastcall ExitActionExecute( TObject *Sender );
void __fastcall PrevTitleActionExecute( TObject *Sender );
void __fastcall NextTitleActionExecute( TObject *Sender );
void __fastcall PrevChapterActionExecute( TObject *Sender );
......
......@@ -26,8 +26,9 @@
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include "win32_common.h"
#include "messages.h"
#include "misc.h"
#include "win32_common.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
......@@ -40,6 +41,7 @@ __fastcall TMessagesDlg::TMessagesDlg( TComponent* Owner )
: TForm( Owner )
{
Icon = p_intfGlobal->p_sys->p_window->Icon;
Translate( this );
}
//---------------------------------------------------------------------------
void __fastcall TMessagesDlg::ButtonOKClick( TObject *Sender )
......
......@@ -34,6 +34,7 @@ object MessagesDlg: TMessagesDlg
WantReturns = False
end
object ButtonOK: TButton
Tag = 3
Left = 144
Top = 437
Width = 145
......
/*****************************************************************************
* misc.cpp: miscellaneous functions.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include <vcl.h>
#pragma hdrstop
#include "misc.h"
/****************************************************************************
* This function replaces "Hint", "Caption" and "Text" properties of each
* component of the form by the appropriate translation.
****************************************************************************/
void __fastcall Translate( TForm *Form )
{
#if 0
Form->Hint = N_( Form->Hint );
Form->Caption = N_( Form->Caption );
int i;
for( i = 0; i < Form->ComponentCount; i++ )
{
// Does this component need a translation ?
if( Form->Components[i]->Tag > 0 )
{
TComponent *Component = Form->Components[i];
// Hint property
if( Component->Tag & 1 )
{
if( Component->InheritsFrom( __classid( TControl ) ) )
{
TControl *Object = (TControl *) Component;
Object->Hint = N_( Object->Hint );
}
else if( Component->InheritsFrom( __classid( TMenuItem ) ) )
{
TMenuItem *Object = (TMenuItem *) Component;
Object->Hint = N_( Object->Hint );
}
}
// Caption property
if( Component->Tag & 2 )
{
if( Component->InheritsFrom( __classid( TMenuItem ) ) )
{
TMenuItem *Object = (TMenuItem *) Component;
Object->Caption = N_( Object->Caption );
}
else if( Component->InheritsFrom( __classid( TLabel ) ) )
{
TLabel *Object = (TLabel *) Component;
Object->Caption = N_( Object->Caption );
}
else if( Component->InheritsFrom( __classid( TButton ) ) )
{
TButton *Object = (TButton *) Component;
Object->Caption = N_( Object->Caption );
}
else if( Component->InheritsFrom( __classid( TToolButton ) ) )
{
TToolButton *Object = (TToolButton *) Component;
Object->Caption = N_( Object->Caption );
}
else if( Component->InheritsFrom( __classid( TRadioButton ) ) )
{
TRadioButton *Object = (TRadioButton *) Component;
Object->Caption = N_( Object->Caption );
}
else if( Component->InheritsFrom( __classid( TCheckBox ) ) )
{
TCheckBox *Object = (TCheckBox *) Component;
Object->Caption = N_( Object->Caption );
}
else if( Component->InheritsFrom( __classid( TRadioGroup ) ) )
{
TRadioGroup *Object = (TRadioGroup *) Component;
Object->Caption = N_( Object->Caption );
}
else if( Component->InheritsFrom( __classid( TGroupBox ) ) )
{
TGroupBox *Object = (TGroupBox *) Component;
Object->Caption = N_( Object->Caption );
}
else if( Component->InheritsFrom( __classid( TTabSheet ) ) )
{
TTabSheet *Object = (TTabSheet *) Component;
Object->Caption = N_( Object->Caption );
}
else if( Component->InheritsFrom( __classid( TListView ) ) )
{
TListView *Object = (TListView *) Component;
int iCol;
for( iCol = 0; iCol < Object->Columns->Count; iCol++ )
Object->Columns->Items[iCol]->Caption =
N_( Object->Columns->Items[iCol]->Caption );
}
}
// Text property
if( Component->Tag & 4 )
{
if( Component->InheritsFrom( __classid( TEdit ) ) )
{
TEdit *Object = (TEdit *) Component;
Object->Text = N_( Object->Text );
}
else if( Component->InheritsFrom( __classid( TComboBox ) ) )
{
TComboBox *Object = (TComboBox *) Component;
Object->Text = N_( Object->Text );
}
}
}
}
#endif
}
/*****************************************************************************
* misc.h: Prototype for main window
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef miscH
#define miscH
void __fastcall Translate( TForm *Form );
#endif
......@@ -27,6 +27,7 @@
#include <vlc/intf.h>
#include "network.h"
#include "misc.h"
#include "win32_common.h"
#include "netutils.h"
......@@ -65,6 +66,8 @@ __fastcall TNetworkDlg::TNetworkDlg( TComponent* Owner )
}
SpinEditCSPort->Value = config_GetInt( p_intfGlobal, "channel-port" );
Translate( this );
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::FormShow( TObject *Sender )
......
......@@ -248,6 +248,7 @@ object NetworkDlg: TNetworkDlg
PixelsPerInch = 96
TextHeight = 13
object BitBtnOk: TBitBtn
Tag = 3
Left = 40
Top = 168
Width = 177
......@@ -257,6 +258,7 @@ object NetworkDlg: TNetworkDlg
Kind = bkOK
end
object BitBtnCancel: TBitBtn
Tag = 3
Left = 256
Top = 168
Width = 177
......@@ -266,6 +268,7 @@ object NetworkDlg: TNetworkDlg
Kind = bkCancel
end
object GroupBoxMode: TGroupBox
Tag = 3
Left = 8
Top = 8
Width = 465
......@@ -273,6 +276,7 @@ object NetworkDlg: TNetworkDlg
Caption = 'Network mode'
TabOrder = 2
object LabelUDPPort: TLabel
Tag = 3
Left = 148
Top = 26
Width = 22
......@@ -280,6 +284,7 @@ object NetworkDlg: TNetworkDlg
Caption = 'Port:'
end
object LabelMulticastPort: TLabel
Tag = 3
Left = 364
Top = 54
Width = 22
......@@ -288,6 +293,7 @@ object NetworkDlg: TNetworkDlg
Enabled = False
end
object LabelCSPort: TLabel
Tag = 3
Left = 364
Top = 82
Width = 22
......@@ -296,6 +302,7 @@ object NetworkDlg: TNetworkDlg
Enabled = False
end
object LabelMulticastAddress: TLabel
Tag = 3
Left = 139
Top = 54
Width = 41
......@@ -304,6 +311,7 @@ object NetworkDlg: TNetworkDlg
Enabled = False
end
object LabelCSAddress: TLabel
Tag = 3
Left = 139
Top = 82
Width = 41
......@@ -312,6 +320,7 @@ object NetworkDlg: TNetworkDlg
Enabled = False
end
object LabelHTTPURL: TLabel
Tag = 3
Left = 147
Top = 110
Width = 25
......@@ -320,6 +329,7 @@ object NetworkDlg: TNetworkDlg
Enabled = False
end
object RadioButtonUDP: TRadioButton
Tag = 3
Left = 16
Top = 24
Width = 97
......@@ -331,6 +341,7 @@ object NetworkDlg: TNetworkDlg
OnEnter = RadioButtonUDPEnter
end
object RadioButtonMulticast: TRadioButton
Tag = 3
Left = 16
Top = 52
Width = 97
......@@ -340,6 +351,7 @@ object NetworkDlg: TNetworkDlg
OnEnter = RadioButtonMulticastEnter
end
object RadioButtonCS: TRadioButton
Tag = 3
Left = 16
Top = 80
Width = 97
......@@ -349,6 +361,7 @@ object NetworkDlg: TNetworkDlg
OnEnter = RadioButtonCSEnter
end
object RadioButtonHTTP: TRadioButton
Tag = 3
Left = 16
Top = 108
Width = 97
......@@ -358,6 +371,7 @@ object NetworkDlg: TNetworkDlg
OnEnter = RadioButtonHTTPEnter
end
object ComboBoxMulticastAddress: TComboBox
Tag = 5
Left = 184
Top = 50
Width = 161
......@@ -367,6 +381,7 @@ object NetworkDlg: TNetworkDlg
TabOrder = 5
end
object ComboBoxCSAddress: TComboBox
Tag = 5
Left = 184
Top = 78
Width = 161
......@@ -379,6 +394,7 @@ object NetworkDlg: TNetworkDlg
'vlcs')
end
object EditHTTPURL: TEdit
Tag = 5
Left = 184
Top = 106
Width = 265
......
......@@ -27,6 +27,7 @@
#include <vlc/intf.h>
#include "playlist.h"
#include "misc.h"
#include "win32_common.h"
//---------------------------------------------------------------------------
......@@ -40,6 +41,7 @@ __fastcall TPlaylistDlg::TPlaylistDlg( TComponent* Owner )
: TForm( Owner )
{
Icon = p_intfGlobal->p_sys->p_window->Icon;
Translate( this );
}
//---------------------------------------------------------------------------
char * __fastcall TPlaylistDlg::rindex( char *s, char c )
......
object PlaylistDlg: TPlaylistDlg
Left = 162
Top = 364
Left = 346
Top = 231
Width = 335
Height = 436
Caption = 'Playlist'
......@@ -17,6 +17,7 @@ object PlaylistDlg: TPlaylistDlg
PixelsPerInch = 96
TextHeight = 13
object BitBtnOk: TBitBtn
Tag = 3
Left = 76
Top = 356
Width = 176
......@@ -28,6 +29,7 @@ object PlaylistDlg: TPlaylistDlg
OnClick = BitBtnOkClick
end
object ListViewPlaylist: TListView
Tag = 3
Left = 11
Top = 10
Width = 305
......@@ -58,41 +60,52 @@ object PlaylistDlg: TPlaylistDlg
Left = 8
Top = 352
object MenuAdd: TMenuItem
Tag = 3
Caption = '&Add'
object MenuAddFile: TMenuItem
Tag = 3
Caption = '&File'
OnClick = MenuAddFileClick
end
object MenuAddDisc: TMenuItem
Tag = 3
Caption = '&Disc'
OnClick = MenuAddDiscClick
end
object MenuAddNet: TMenuItem
Tag = 3
Caption = '&Network'
OnClick = MenuAddNetClick
end
object MenuAddUrl: TMenuItem
Tag = 3
Caption = '&Url'
Enabled = False
OnClick = MenuAddUrlClick
end
end
object MenuDelete: TMenuItem
Tag = 3
Caption = '&Delete'
object MenuDeleteAll: TMenuItem
Tag = 3
Action = DeleteAllAction
end
object MenuDeleteSelected: TMenuItem
Tag = 3
Action = DeleteSelectionAction
Caption = '&Selection'
end
end
object MenuSelection: TMenuItem
Tag = 3
Caption = '&Selection'
object MenuSelectionCrop: TMenuItem
Tag = 3
Action = CropSelectionAction
end
object MenuSelectionInvert: TMenuItem
Tag = 3
Action = InvertSelectionAction
end
end
......@@ -101,16 +114,19 @@ object PlaylistDlg: TPlaylistDlg
Left = 40
Top = 352
object PopupPlay: TMenuItem
Tag = 3
Action = PlayStreamAction
end
object N1: TMenuItem
Caption = '-'
end
object PopupInvertSelection: TMenuItem
Tag = 3
Action = InvertSelectionAction
Caption = '&Invert selection'
end
object PopupCropSelection: TMenuItem
Tag = 3
Action = CropSelectionAction
Caption = '&Crop selection'
end
......@@ -118,10 +134,12 @@ object PlaylistDlg: TPlaylistDlg
Caption = '-'
end
object PopupDeleteSelected: TMenuItem
Tag = 3
Action = DeleteSelectionAction
Caption = '&Delete selection'
end
object PopupDeleteAll: TMenuItem
Tag = 3
Action = DeleteAllAction
Caption = 'Delete &all'
end
......@@ -130,26 +148,31 @@ object PlaylistDlg: TPlaylistDlg
Left = 264
Top = 352
object InvertSelectionAction: TAction
Tag = 3
Caption = 'Invert'
Hint = 'Invert selection'
OnExecute = InvertSelectionActionExecute
end
object CropSelectionAction: TAction
Tag = 3
Caption = 'Crop'
Hint = 'Crop selection'
OnExecute = CropSelectionActionExecute
end
object DeleteSelectionAction: TAction
Tag = 3
Caption = 'Delete'
Hint = 'Delete selection'
OnExecute = DeleteSelectionActionExecute
end
object DeleteAllAction: TAction
Tag = 3
Caption = 'All'
Hint = 'Delete all items'
OnExecute = DeleteAllActionExecute
end
object PlayStreamAction: TAction
Tag = 3
Caption = 'Play'
Hint = 'Play the selected stream'
OnExecute = PlayStreamActionExecute
......
USEUNIT("win32.cpp");
USEUNIT("intf_win32.cpp");
USEFORM("mainframe.cpp", MainFrameDlg);
USEFORM("network.cpp", NetworkDlg);
USEFORM("playlist.cpp", PlaylistDlg);
......@@ -10,6 +9,7 @@ USEUNIT("control.cpp");
USE("win32_common.h", File);
USEUNIT("menu.cpp");
USEFORM("messages.cpp", MessagesDlg);
USEUNIT("misc.cpp");
//---------------------------------------------------------------------------
This file is used by the project manager only and should be treated like the project file
......
......@@ -4,8 +4,8 @@
<MACROS>
<VERSION value="BCB.05.03"/>
<PROJECT value="win32.so"/>
<OBJFILES value="win32.obj mainframe.obj network.obj playlist.obj
preferences.obj about.obj disc.obj control.obj menu.obj messages.obj"/>
<OBJFILES value="win32.obj mainframe.obj network.obj playlist.obj preferences.obj about.obj
disc.obj control.obj menu.obj messages.obj misc.obj"/>
<RESFILES value=""/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES) mainframe.dfm network.dfm playlist.dfm preferences.dfm
......@@ -23,7 +23,7 @@
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="tlink32"/>
<USERDEFINES value="_DEBUG"/>
<USERDEFINES value="_DEBUG;WIN32;__VLC__;__PLUGIN__;MODULE_NAME_IS_win32"/>
<SYSDEFINES value="NO_STRICT"/>
<MAINSOURCE value="win32.bpf"/>
<INCLUDEPATH value="..\..\win32;$(BCB)\include;$(BCB)\include\vcl;..\..\..\include;..\..\.."/>
......@@ -72,20 +72,25 @@ ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlIncludePath]
Count1=
Item0=..\win32;..\..\win32;$(BCB)\include;$(BCB)\include\vcl;..\..\include;..\..\src\misc
Count=1
Item0=..\..\win32;$(BCB)\include;$(BCB)\include\vcl;..\..\..\include;..\..\src\misc
[HistoryLists\hlLibraryPath]
Count=1
Item0=..\win32;..\..\win32;$(BCB)\lib\obj;$(BCB)\lib
Count=2
Item0=..\..\win32;$(BCB)\lib\obj;$(BCB)\lib
Item1=..\win32;..\..\win32;$(BCB)\lib\obj;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=1
Item0=$(BCB)\source\vcl
[HistoryLists\hlConditionals]
Count=1
Item0=_DEBUG
Count=5
Item0=_DEBUG;WIN32;__VLC__;__PLUGIN__;MODULE_NAME_IS_win32
Item1=_DEBUG;WIN32;__VLC__;__PLUGIN__;MODULE_NAME_IS_win32;MODULE_NAME=win32;MODULE_PATH=modules_gui_win32_win32
Item2=_DEBUG;__VLC__;__PLUGIN__;MODULE_NAME_IS_win32;MODULE_NAME=win32;MODULE_PATH=modules_gui_win32_win32
Item3=_DEBUG;__VLC__;__PLUGIN__
Item4=_DEBUG
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment