2006-01-16 22:02:54 +01:00
// Copyright (c) 2005, Rodrigo Braz Monteiro
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of the Aegisub Group nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
2009-07-29 07:43:02 +02:00
// Aegisub Project http://www.aegisub.org/
2006-01-16 22:02:54 +01:00
//
2009-07-29 07:43:02 +02:00
// $Id$
/// @file subs_edit_box.cpp
/// @brief Main subtitle editing area, including toolbars around the text control
/// @ingroup main_ui
///
2006-01-16 22:02:54 +01:00
////////////
// Includes
2009-01-04 07:31:48 +01:00
# include "config.h"
2009-09-10 15:06:40 +02:00
# ifndef AGI_PRE
2006-12-24 05:54:35 +01:00
# include <wx/colordlg.h>
# include <wx/fontdlg.h>
2009-09-10 15:06:40 +02:00
# endif
2006-01-16 22:02:54 +01:00
# include "ass_dialogue.h"
2009-09-10 15:06:40 +02:00
# include "ass_file.h"
2006-01-16 22:02:54 +01:00
# include "ass_override.h"
2009-09-10 15:06:40 +02:00
# include "ass_style.h"
2006-01-16 22:02:54 +01:00
# include "audio_display.h"
# include "dialog_colorpicker.h"
2006-03-05 21:42:38 +01:00
# include "dialog_search_replace.h"
2009-09-10 15:06:40 +02:00
# include "frame_main.h"
# include "hilimod_textctrl.h"
2006-12-29 04:02:17 +01:00
# include "idle_field_event.h"
2009-07-24 02:08:25 +02:00
# include "libresrc/libresrc.h"
2009-09-10 15:06:40 +02:00
# include "main.h"
# include "subs_edit_box.h"
# include "subs_grid.h"
# include "timeedit_ctrl.h"
# include "tooltip_manager.h"
# include "utils.h"
# include "validators.h"
# include "video_context.h"
# include "video_display.h"
2006-01-16 22:02:54 +01:00
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Constructor
/// @param parent
/// @param gridp
///
2006-01-16 22:02:54 +01:00
SubsEditBox : : SubsEditBox ( wxWindow * parent , SubtitlesGrid * gridp ) : wxPanel ( parent , - 1 , wxDefaultPosition , wxDefaultSize , wxTAB_TRAVERSAL | wxRAISED_BORDER , _T ( " SubsEditBox " ) )
{
// Setup
audio = NULL ;
grid = gridp ;
grid - > editBox = this ;
enabled = false ;
textEditReady = true ;
controlState = true ;
2006-12-27 01:00:41 +01:00
setupDone = false ;
2006-01-16 22:02:54 +01:00
// Top controls
wxArrayString styles ;
2009-09-05 04:24:52 +02:00
styles . Add ( _T ( " Default " ) ) ;
2006-01-16 22:02:54 +01:00
CommentBox = new wxCheckBox ( this , COMMENT_CHECKBOX , _ ( " Comment " ) ) ;
CommentBox - > SetToolTip ( _ ( " Comment this line out. Commented lines don't show up on screen. " ) ) ;
2009-09-05 04:24:52 +02:00
StyleBox = new wxComboBox ( this , STYLE_COMBOBOX , _T ( " Default " ) , wxDefaultPosition , wxSize ( 110 , - 1 ) , styles , wxCB_READONLY | wxTE_PROCESS_ENTER ) ;
2006-01-16 22:02:54 +01:00
StyleBox - > SetToolTip ( _ ( " Style for this line. " ) ) ;
2009-09-05 04:24:52 +02:00
ActorBox = new wxComboBox ( this , ACTOR_COMBOBOX , _T ( " Actor " ) , wxDefaultPosition , wxSize ( 110 , - 1 ) , styles , wxCB_DROPDOWN | wxTE_PROCESS_ENTER ) ;
2006-01-16 22:02:54 +01:00
ActorBox - > SetToolTip ( _ ( " Actor name for this speech. This is only for reference, and is mainly useless. " ) ) ;
2006-12-29 04:02:17 +01:00
ActorBox - > PushEventHandler ( new IdleFieldHandler ( ActorBox , _ ( " Actor " ) ) ) ;
2007-09-21 18:20:00 +02:00
Effect = new HiliModTextCtrl ( this , EFFECT_BOX , _T ( " " ) , wxDefaultPosition , wxSize ( 80 , - 1 ) , wxTE_PROCESS_ENTER ) ;
2006-12-24 17:17:40 +01:00
Effect - > SetToolTip ( _ ( " Effect for this line. This can be used to store extra information for karaoke scripts, or for the effects supported by the renderer. " ) ) ;
2006-12-29 04:02:17 +01:00
Effect - > PushEventHandler ( new IdleFieldHandler ( Effect , _ ( " Effect " ) ) ) ;
2006-01-16 22:02:54 +01:00
// Middle controls
2007-09-21 18:20:00 +02:00
Layer = new wxSpinCtrl ( this , LAYER_BOX , _T ( " " ) , wxDefaultPosition , wxSize ( 50 , - 1 ) , wxSP_ARROW_KEYS , 0 , 0x7FFFFFFF , 0 ) ;
2006-01-16 22:02:54 +01:00
Layer - > SetToolTip ( _ ( " Layer number " ) ) ;
2007-09-21 18:20:00 +02:00
StartTime = new TimeEdit ( this , STARTTIME_BOX , _T ( " " ) , wxDefaultPosition , wxSize ( 75 , - 1 ) , wxTE_PROCESS_ENTER ) ;
2006-01-16 22:02:54 +01:00
StartTime - > SetToolTip ( _ ( " Start time " ) ) ;
StartTime - > showModified = true ;
2007-09-21 18:20:00 +02:00
EndTime = new TimeEdit ( this , ENDTIME_BOX , _T ( " " ) , wxDefaultPosition , wxSize ( 75 , - 1 ) , wxTE_PROCESS_ENTER ) ;
2006-01-16 22:02:54 +01:00
EndTime - > SetToolTip ( _ ( " End time " ) ) ;
EndTime - > isEnd = true ;
EndTime - > showModified = true ;
2007-09-21 18:20:00 +02:00
Duration = new TimeEdit ( this , DURATION_BOX , _T ( " " ) , wxDefaultPosition , wxSize ( 75 , - 1 ) , wxTE_PROCESS_ENTER ) ;
2006-01-16 22:02:54 +01:00
Duration - > SetToolTip ( _ ( " Line duration " ) ) ;
Duration - > showModified = true ;
2007-09-21 18:20:00 +02:00
MarginL = new HiliModTextCtrl ( this , MARGINL_BOX , _T ( " " ) , wxDefaultPosition , wxSize ( 40 , - 1 ) , wxTE_CENTRE | wxTE_PROCESS_ENTER , NumValidator ( ) ) ;
2006-12-30 15:31:41 +01:00
MarginL - > SetToolTip ( _ ( " Left Margin (0 = default) " ) ) ;
MarginL - > SetMaxLength ( 4 ) ;
2007-09-21 18:20:00 +02:00
MarginR = new HiliModTextCtrl ( this , MARGINR_BOX , _T ( " " ) , wxDefaultPosition , wxSize ( 40 , - 1 ) , wxTE_CENTRE | wxTE_PROCESS_ENTER , NumValidator ( ) ) ;
2006-12-30 15:31:41 +01:00
MarginR - > SetToolTip ( _ ( " Right Margin (0 = default) " ) ) ;
MarginR - > SetMaxLength ( 4 ) ;
2007-09-21 18:20:00 +02:00
MarginV = new HiliModTextCtrl ( this , MARGINV_BOX , _T ( " " ) , wxDefaultPosition , wxSize ( 40 , - 1 ) , wxTE_CENTRE | wxTE_PROCESS_ENTER , NumValidator ( ) ) ;
2006-12-30 15:31:41 +01:00
MarginV - > SetToolTip ( _ ( " Vertical Margin (0 = default) " ) ) ;
MarginV - > SetMaxLength ( 4 ) ;
2006-01-16 22:02:54 +01:00
// Middle-bottom controls
2010-06-29 20:33:22 +02:00
Bold = new wxBitmapButton ( this , BUTTON_BOLD , GETIMAGE ( button_bold_16 ) , wxDefaultPosition , wxDefaultSize ) ;
2006-01-16 22:02:54 +01:00
Bold - > SetToolTip ( _ ( " Bold " ) ) ;
2010-06-29 20:33:22 +02:00
Italics = new wxBitmapButton ( this , BUTTON_ITALICS , GETIMAGE ( button_italics_16 ) , wxDefaultPosition , wxDefaultSize ) ;
2006-01-16 22:02:54 +01:00
Italics - > SetToolTip ( _ ( " Italics " ) ) ;
2010-06-29 20:33:22 +02:00
Underline = new wxBitmapButton ( this , BUTTON_UNDERLINE , GETIMAGE ( button_underline_16 ) , wxDefaultPosition , wxDefaultSize ) ;
2006-01-16 22:02:54 +01:00
Underline - > SetToolTip ( _ ( " Underline " ) ) ;
2010-06-29 20:33:22 +02:00
Strikeout = new wxBitmapButton ( this , BUTTON_STRIKEOUT , GETIMAGE ( button_strikeout_16 ) , wxDefaultPosition , wxDefaultSize ) ;
2006-01-16 22:02:54 +01:00
Strikeout - > SetToolTip ( _ ( " Strikeout " ) ) ;
2010-06-29 20:33:22 +02:00
FontName = new wxBitmapButton ( this , BUTTON_FONT_NAME , GETIMAGE ( button_fontname_16 ) , wxDefaultPosition , wxDefaultSize ) ;
2006-01-16 22:02:54 +01:00
FontName - > SetToolTip ( _ ( " Font Face Name " ) ) ;
2010-06-29 20:33:22 +02:00
Color1 = new wxBitmapButton ( this , BUTTON_COLOR1 , GETIMAGE ( button_color_one_16 ) , wxDefaultPosition , wxDefaultSize ) ;
2006-01-16 22:02:54 +01:00
Color1 - > SetToolTip ( _ ( " Primary color " ) ) ;
2010-06-29 20:33:22 +02:00
Color2 = new wxBitmapButton ( this , BUTTON_COLOR2 , GETIMAGE ( button_color_two_16 ) , wxDefaultPosition , wxDefaultSize ) ;
2006-01-16 22:02:54 +01:00
Color2 - > SetToolTip ( _ ( " Secondary color " ) ) ;
2010-06-29 20:33:22 +02:00
Color3 = new wxBitmapButton ( this , BUTTON_COLOR3 , GETIMAGE ( button_color_three_16 ) , wxDefaultPosition , wxDefaultSize ) ;
2006-01-16 22:02:54 +01:00
Color3 - > SetToolTip ( _ ( " Outline color " ) ) ;
2010-06-29 20:33:22 +02:00
Color4 = new wxBitmapButton ( this , BUTTON_COLOR4 , GETIMAGE ( button_color_four_16 ) , wxDefaultPosition , wxDefaultSize ) ;
2006-01-16 22:02:54 +01:00
Color4 - > SetToolTip ( _ ( " Shadow color " ) ) ;
2010-06-29 20:33:22 +02:00
CommitButton = new wxBitmapButton ( this , BUTTON_COMMIT , GETIMAGE ( button_audio_commit_16 ) , wxDefaultPosition , wxDefaultSize ) ;
2007-06-30 22:59:32 +02:00
ToolTipManager : : Bind ( CommitButton , _ ( " Commits the text (Enter). Hold Ctrl to stay in line (%KEY%). " ) , _T ( " Edit Box Commit " ) ) ;
2006-12-24 17:17:40 +01:00
ByTime = new wxRadioButton ( this , RADIO_TIME_BY_TIME , _ ( " Time " ) , wxDefaultPosition , wxDefaultSize , wxRB_GROUP ) ;
ByTime - > SetToolTip ( _ ( " Time by h:mm:ss.cs " ) ) ;
ByFrame = new wxRadioButton ( this , RADIO_TIME_BY_FRAME , _ ( " Frame " ) ) ;
ByFrame - > SetToolTip ( _ ( " Time by frame number " ) ) ;
2006-06-27 06:13:34 +02:00
// Top sizer
2006-12-27 01:00:41 +01:00
TopSizer = new wxBoxSizer ( wxHORIZONTAL ) ;
2008-03-10 00:00:03 +01:00
TopSizer - > Add ( CommentBox , 0 , wxRIGHT | wxALIGN_CENTER , 5 ) ;
TopSizer - > Add ( StyleBox , 2 , wxRIGHT | wxALIGN_CENTER , 5 ) ;
TopSizer - > Add ( ActorBox , 2 , wxRIGHT | wxALIGN_CENTER , 5 ) ;
TopSizer - > Add ( Effect , 3 , wxALIGN_CENTER , 5 ) ;
2006-06-27 06:13:34 +02:00
// Middle sizer
2006-12-27 01:00:41 +01:00
splitLineMode = true ;
MiddleSizer = new wxBoxSizer ( wxHORIZONTAL ) ;
2007-09-21 18:20:00 +02:00
MiddleSizer - > Add ( Layer , 0 , wxRIGHT | wxALIGN_CENTER , 5 ) ;
MiddleSizer - > Add ( StartTime , 0 , wxRIGHT | wxALIGN_CENTER , 0 ) ;
MiddleSizer - > Add ( EndTime , 0 , wxRIGHT | wxALIGN_CENTER , 5 ) ;
MiddleSizer - > Add ( Duration , 0 , wxRIGHT | wxALIGN_CENTER , 5 ) ;
MiddleSizer - > Add ( MarginL , 0 , wxALIGN_CENTER , 0 ) ;
MiddleSizer - > Add ( MarginR , 0 , wxALIGN_CENTER , 0 ) ;
MiddleSizer - > Add ( MarginV , 0 , wxALIGN_CENTER , 0 ) ;
2006-12-27 01:00:41 +01:00
MiddleSizer - > AddSpacer ( 5 ) ;
2006-01-16 22:02:54 +01:00
// Middle-bottom sizer
2006-12-27 01:00:41 +01:00
MiddleBotSizer = new wxBoxSizer ( wxHORIZONTAL ) ;
2008-03-09 23:31:16 +01:00
MiddleBotSizer - > Add ( Bold , 0 , wxALIGN_CENTER | wxEXPAND , 0 ) ;
MiddleBotSizer - > Add ( Italics , 0 , wxALIGN_CENTER | wxEXPAND , 0 ) ;
MiddleBotSizer - > Add ( Underline , 0 , wxALIGN_CENTER | wxEXPAND , 0 ) ;
MiddleBotSizer - > Add ( Strikeout , 0 , wxALIGN_CENTER | wxEXPAND , 0 ) ;
MiddleBotSizer - > Add ( FontName , 0 , wxALIGN_CENTER | wxEXPAND , 0 ) ;
2006-01-16 22:02:54 +01:00
MiddleBotSizer - > AddSpacer ( 5 ) ;
2008-03-09 23:31:16 +01:00
MiddleBotSizer - > Add ( Color1 , 0 , wxALIGN_CENTER | wxEXPAND , 0 ) ;
MiddleBotSizer - > Add ( Color2 , 0 , wxALIGN_CENTER | wxEXPAND , 0 ) ;
MiddleBotSizer - > Add ( Color3 , 0 , wxALIGN_CENTER | wxEXPAND , 0 ) ;
MiddleBotSizer - > Add ( Color4 , 0 , wxALIGN_CENTER | wxEXPAND , 0 ) ;
MiddleBotSizer - > AddSpacer ( 5 ) ;
MiddleBotSizer - > Add ( CommitButton , 0 , wxALIGN_CENTER , 0 ) ;
MiddleBotSizer - > AddSpacer ( 10 ) ;
MiddleBotSizer - > Add ( ByTime , 0 , wxRIGHT | wxALIGN_CENTER | wxEXPAND , 5 ) ;
MiddleBotSizer - > Add ( ByFrame , 0 , wxRIGHT | wxALIGN_CENTER | wxEXPAND , 5 ) ;
2006-01-16 22:02:54 +01:00
// Text editor
2009-07-25 20:45:30 +02:00
int textStyle = wxBORDER_SUNKEN ;
2008-03-11 08:05:19 +01:00
TextEdit = new SubsTextEditCtrl ( this , EDIT_BOX , _T ( " " ) , wxDefaultPosition , wxSize ( 300 , 50 ) , textStyle ) ;
2006-01-16 22:02:54 +01:00
TextEdit - > PushEventHandler ( new SubsEditBoxEvent ( this ) ) ;
TextEdit - > control = this ;
2006-12-27 01:00:41 +01:00
BottomSizer = new wxBoxSizer ( wxHORIZONTAL ) ;
2006-01-16 22:02:54 +01:00
BottomSizer - > Add ( TextEdit , 1 , wxEXPAND , 0 ) ;
// Main sizer
2006-12-27 01:00:41 +01:00
MainSizer = new wxBoxSizer ( wxVERTICAL ) ;
2008-03-09 23:31:16 +01:00
MainSizer - > Add ( TopSizer , 0 , wxEXPAND | wxALL , 3 ) ;
2006-01-16 22:02:54 +01:00
MainSizer - > Add ( MiddleSizer , 0 , wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM , 3 ) ;
MainSizer - > Add ( MiddleBotSizer , 0 , wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM , 3 ) ;
MainSizer - > Add ( BottomSizer , 1 , wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM , 3 ) ;
// Set sizer
SetSizer ( MainSizer ) ;
MainSizer - > SetSizeHints ( this ) ;
// HACK: Fix colour of bg of editbox
origBgColour = TextEdit - > GetBackgroundColour ( ) ;
disabledBgColour = GetBackgroundColour ( ) ;
2006-12-27 01:00:41 +01:00
// Set split mode
setupDone = true ;
SetSplitLineMode ( ) ;
2006-02-19 01:54:35 +01:00
Update ( ) ;
2010-06-26 13:32:16 +02:00
grid - > AddSelectionListener ( this ) ;
2006-01-16 22:02:54 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Destructor
///
2009-05-18 07:33:49 +02:00
SubsEditBox : : ~ SubsEditBox ( ) {
2010-06-26 13:32:16 +02:00
grid - > RemoveSelectionListener ( this ) ;
2009-05-18 07:33:49 +02:00
ActorBox - > PopEventHandler ( true ) ;
Effect - > PopEventHandler ( true ) ;
TextEdit - > PopEventHandler ( true ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Set split or single line mode
/// @param newSize
///
2006-12-27 01:00:41 +01:00
void SubsEditBox : : SetSplitLineMode ( wxSize newSize ) {
// Widths
int topWidth ;
if ( newSize . GetWidth ( ) = = - 1 ) topWidth = TopSizer - > GetSize ( ) . GetWidth ( ) ;
else topWidth = newSize . GetWidth ( ) - GetSize ( ) . GetWidth ( ) + GetClientSize ( ) . GetWidth ( ) ;
int midMin = MiddleSizer - > GetMinSize ( ) . GetWidth ( ) ;
int botMin = MiddleBotSizer - > GetMinSize ( ) . GetWidth ( ) ;
// Currently split
if ( splitLineMode ) {
if ( topWidth > = midMin + botMin ) {
MainSizer - > Detach ( MiddleBotSizer ) ;
2008-03-09 23:31:16 +01:00
MiddleSizer - > Add ( MiddleBotSizer , 0 , wxALIGN_CENTER_VERTICAL ) ;
2006-12-27 01:00:41 +01:00
Layout ( ) ;
splitLineMode = false ;
}
}
// Currently joined
else {
if ( topWidth < midMin ) {
MiddleSizer - > Detach ( MiddleBotSizer ) ;
MainSizer - > Insert ( 2 , MiddleBotSizer , 0 , wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM , 3 ) ;
Layout ( ) ;
splitLineMode = true ;
}
}
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Update function
2010-05-26 09:17:39 +02:00
/// @param timeOnly
/// @param weak
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
///
2010-06-28 09:13:08 +02:00
void SubsEditBox : : Update ( bool timeOnly , bool weak ) {
2006-01-16 22:02:54 +01:00
if ( enabled ) {
2010-06-26 13:32:16 +02:00
AssDialogue * curdiag = grid - > GetActiveLine ( ) ;
2006-01-16 22:02:54 +01:00
if ( curdiag ) {
// Controls
SetControlsState ( true ) ;
int start = curdiag - > Start . GetMS ( ) ;
int end = curdiag - > End . GetMS ( ) ;
StartTime - > SetTime ( start ) ;
2009-04-26 06:31:19 +02:00
StartTime - > Update ( ) ;
2006-01-16 22:02:54 +01:00
EndTime - > SetTime ( end ) ;
2009-04-26 06:31:19 +02:00
EndTime - > Update ( ) ;
2006-01-16 22:02:54 +01:00
Duration - > SetTime ( end - start ) ;
2009-04-26 06:31:19 +02:00
Duration - > Update ( ) ;
2006-01-16 22:02:54 +01:00
if ( ! timeOnly ) {
2006-12-24 18:42:09 +01:00
TextEdit - > SetTextTo ( curdiag - > Text ) ;
2009-06-01 15:57:34 +02:00
Layer - > SetValue ( curdiag - > Layer ) ;
2007-01-05 19:27:15 +01:00
MarginL - > SetValue ( curdiag - > GetMarginString ( 0 , false ) ) ;
MarginR - > SetValue ( curdiag - > GetMarginString ( 1 , false ) ) ;
MarginV - > SetValue ( curdiag - > GetMarginString ( 2 , false ) ) ;
2006-06-27 06:13:34 +02:00
Effect - > SetValue ( curdiag - > Effect ) ;
2006-01-16 22:02:54 +01:00
CommentBox - > SetValue ( curdiag - > Comment ) ;
StyleBox - > Select ( StyleBox - > FindString ( curdiag - > Style ) ) ;
ActorBox - > SetValue ( curdiag - > Actor ) ;
ActorBox - > SetStringSelection ( curdiag - > Actor ) ;
2006-12-29 04:02:17 +01:00
// Force actor box to update its idle status
wxCommandEvent changeEvent ( wxEVT_COMMAND_TEXT_UPDATED , ActorBox - > GetId ( ) ) ;
ActorBox - > GetEventHandler ( ) - > AddPendingEvent ( changeEvent ) ;
2006-01-16 22:02:54 +01:00
}
// Audio
2010-06-26 13:32:16 +02:00
if ( ! weak ) audio - > SetDialogue ( grid , curdiag , grid - > GetDialogueIndex ( curdiag ) ) ;
2006-01-16 22:02:54 +01:00
2009-07-04 03:46:06 +02:00
TextEdit - > EmptyUndoBuffer ( ) ;
2006-01-16 22:02:54 +01:00
}
else enabled = false ;
}
else {
SetControlsState ( false ) ;
}
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Update globals
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : UpdateGlobals ( ) {
// Styles
StyleBox - > Clear ( ) ;
StyleBox - > Append ( grid - > ass - > GetStyles ( ) ) ;
// Actors
ActorBox - > Freeze ( ) ;
ActorBox - > Clear ( ) ;
int nrows = grid - > GetRows ( ) ;
wxString actor ;
for ( int i = 0 ; i < nrows ; i + + ) {
actor = grid - > GetDialogue ( i ) - > Actor ;
2009-09-05 04:24:52 +02:00
// OSX doesn't like combo boxes that are empty.
if ( actor = = " " ) actor = _T ( " Actor " ) ;
2006-01-16 22:02:54 +01:00
if ( ActorBox - > FindString ( actor ) = = wxNOT_FOUND ) {
ActorBox - > Append ( actor ) ;
}
}
ActorBox - > Thaw ( ) ;
// Set subs update
2010-07-13 07:29:08 +02:00
OnActiveLineChanged ( grid - > GetActiveLine ( ) ) ;
2006-01-16 22:02:54 +01:00
TextEdit - > SetSelection ( 0 , 0 ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
2006-01-16 22:02:54 +01:00
///////////////
// Event table
BEGIN_EVENT_TABLE ( SubsEditBox , wxPanel )
2007-04-22 01:16:38 +02:00
EVT_STC_MODIFIED ( EDIT_BOX , SubsEditBox : : OnEditText )
EVT_STC_STYLENEEDED ( EDIT_BOX , SubsEditBox : : OnNeedStyle )
EVT_STC_KEY ( EDIT_BOX , SubsEditBox : : OnKeyDown )
EVT_STC_CHARADDED ( EDIT_BOX , SubsEditBox : : OnCharAdded )
EVT_STC_UPDATEUI ( EDIT_BOX , SubsEditBox : : OnUpdateUI )
2007-01-02 06:00:55 +01:00
2006-01-16 22:02:54 +01:00
EVT_CHECKBOX ( SYNTAX_BOX , SubsEditBox : : OnSyntaxBox )
EVT_RADIOBUTTON ( RADIO_TIME_BY_FRAME , SubsEditBox : : OnFrameRadio )
EVT_RADIOBUTTON ( RADIO_TIME_BY_TIME , SubsEditBox : : OnTimeRadio )
EVT_COMBOBOX ( STYLE_COMBOBOX , SubsEditBox : : OnStyleChange )
EVT_COMBOBOX ( ACTOR_COMBOBOX , SubsEditBox : : OnActorChange )
EVT_TEXT_ENTER ( ACTOR_COMBOBOX , SubsEditBox : : OnActorChange )
2007-10-29 16:30:04 +01:00
EVT_TEXT_ENTER ( LAYER_BOX , SubsEditBox : : OnLayerEnter )
2007-06-18 01:49:51 +02:00
EVT_SPINCTRL ( LAYER_BOX , SubsEditBox : : OnLayerChange )
2006-01-16 22:02:54 +01:00
EVT_TEXT_ENTER ( STARTTIME_BOX , SubsEditBox : : OnStartTimeChange )
EVT_TEXT_ENTER ( ENDTIME_BOX , SubsEditBox : : OnEndTimeChange )
EVT_TEXT_ENTER ( DURATION_BOX , SubsEditBox : : OnDurationChange )
EVT_TEXT_ENTER ( MARGINL_BOX , SubsEditBox : : OnMarginLChange )
EVT_TEXT_ENTER ( MARGINR_BOX , SubsEditBox : : OnMarginRChange )
EVT_TEXT_ENTER ( MARGINV_BOX , SubsEditBox : : OnMarginVChange )
2006-06-27 06:13:34 +02:00
EVT_TEXT_ENTER ( EFFECT_BOX , SubsEditBox : : OnEffectChange )
2006-01-16 22:02:54 +01:00
EVT_CHECKBOX ( COMMENT_CHECKBOX , SubsEditBox : : OnCommentChange )
EVT_BUTTON ( BUTTON_COLOR1 , SubsEditBox : : OnButtonColor1 )
EVT_BUTTON ( BUTTON_COLOR2 , SubsEditBox : : OnButtonColor2 )
EVT_BUTTON ( BUTTON_COLOR3 , SubsEditBox : : OnButtonColor3 )
EVT_BUTTON ( BUTTON_COLOR4 , SubsEditBox : : OnButtonColor4 )
EVT_BUTTON ( BUTTON_FONT_NAME , SubsEditBox : : OnButtonFontFace )
EVT_BUTTON ( BUTTON_BOLD , SubsEditBox : : OnButtonBold )
EVT_BUTTON ( BUTTON_ITALICS , SubsEditBox : : OnButtonItalics )
EVT_BUTTON ( BUTTON_UNDERLINE , SubsEditBox : : OnButtonUnderline )
EVT_BUTTON ( BUTTON_STRIKEOUT , SubsEditBox : : OnButtonStrikeout )
2007-06-30 22:00:07 +02:00
EVT_BUTTON ( BUTTON_COMMIT , SubsEditBox : : OnButtonCommit )
2006-12-27 01:00:41 +01:00
EVT_SIZE ( SubsEditBox : : OnSize )
2006-01-16 22:02:54 +01:00
END_EVENT_TABLE ( )
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief On size
/// @param event
///
2006-12-27 01:00:41 +01:00
void SubsEditBox : : OnSize ( wxSizeEvent & event ) {
if ( setupDone ) SetSplitLineMode ( event . GetSize ( ) ) ;
event . Skip ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Text edited event
/// @param event
///
2007-04-22 01:16:38 +02:00
void SubsEditBox : : OnEditText ( wxStyledTextEvent & event ) {
2007-01-02 06:00:55 +01:00
int modType = event . GetModificationType ( ) ;
2007-04-22 01:16:38 +02:00
if ( modType = = ( wxSTC_MOD_INSERTTEXT | wxSTC_PERFORMED_USER ) | | modType = = ( wxSTC_MOD_DELETETEXT | wxSTC_PERFORMED_USER ) ) {
2007-01-02 06:00:55 +01:00
//TextEdit->UpdateCallTip();
}
2006-12-24 05:54:35 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief User Interface updated
/// @param event
///
2007-04-22 01:16:38 +02:00
void SubsEditBox : : OnUpdateUI ( wxStyledTextEvent & event ) {
2007-01-02 19:09:56 +01:00
TextEdit - > UpdateCallTip ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Need style
/// @param event
///
2007-04-22 01:16:38 +02:00
void SubsEditBox : : OnNeedStyle ( wxStyledTextEvent & event ) {
2006-12-24 05:54:35 +01:00
// Check if it needs to fix text
wxString text = TextEdit - > GetText ( ) ;
if ( text . Contains ( _T ( " \n " ) ) | | text . Contains ( _T ( " \r " ) ) ) {
2006-12-24 18:42:09 +01:00
TextEdit - > SetTextTo ( TextEdit - > GetText ( ) ) ;
2006-01-16 22:02:54 +01:00
}
2006-12-24 05:54:35 +01:00
// Just update style
2006-12-24 18:42:09 +01:00
else TextEdit - > UpdateStyle ( ) ;
2006-01-16 22:02:54 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Character added
/// @param event
///
2007-04-22 01:16:38 +02:00
void SubsEditBox : : OnCharAdded ( wxStyledTextEvent & event ) {
2007-01-24 04:54:32 +01:00
//int character = event.GetKey();
2007-01-02 06:00:55 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Key down
/// @param event
///
2007-04-22 01:16:38 +02:00
void SubsEditBox : : OnKeyDown ( wxStyledTextEvent & event ) {
2007-01-02 19:28:09 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Syntax highlight checkbox
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnSyntaxBox ( wxCommandEvent & event ) {
2006-12-24 18:42:09 +01:00
TextEdit - > UpdateStyle ( ) ;
2010-05-21 03:13:36 +02:00
OPT_SET ( " Subtitle/Highlight/Syntax " ) - > SetBool ( SyntaxHighlight - > GetValue ( ) ) ;
2006-01-16 22:02:54 +01:00
event . Skip ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Time by frame radiobox
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnFrameRadio ( wxCommandEvent & event ) {
if ( ByFrame - > GetValue ( ) ) {
StartTime - > SetByFrame ( true ) ;
EndTime - > SetByFrame ( true ) ;
2007-01-08 04:05:26 +01:00
Duration - > SetByFrame ( true ) ;
2006-01-16 22:02:54 +01:00
grid - > SetByFrame ( true ) ;
}
event . Skip ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Standard time radiobox
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnTimeRadio ( wxCommandEvent & event ) {
if ( ByTime - > GetValue ( ) ) {
StartTime - > SetByFrame ( false ) ;
EndTime - > SetByFrame ( false ) ;
2007-01-08 04:05:26 +01:00
Duration - > SetByFrame ( false ) ;
2006-01-16 22:02:54 +01:00
grid - > SetByFrame ( false ) ;
}
event . Skip ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Sets state (enabled/disabled) for all controls
/// @param state
/// @return
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : SetControlsState ( bool state ) {
if ( state = = controlState ) return ;
controlState = state ;
// HACK: TextEdit workaround the stupid colour lock bug
2006-12-24 05:54:35 +01:00
TextEdit - > SetReadOnly ( ! state ) ;
2006-01-16 22:02:54 +01:00
if ( state ) TextEdit - > SetBackgroundColour ( origBgColour ) ;
else TextEdit - > SetBackgroundColour ( disabledBgColour ) ;
// Sets controls
StartTime - > Enable ( state ) ;
EndTime - > Enable ( state ) ;
Duration - > Enable ( state ) ;
Layer - > Enable ( state ) ;
MarginL - > Enable ( state ) ;
MarginR - > Enable ( state ) ;
MarginV - > Enable ( state ) ;
2006-06-27 06:13:34 +02:00
Effect - > Enable ( state ) ;
2006-01-16 22:02:54 +01:00
CommentBox - > Enable ( state ) ;
StyleBox - > Enable ( state ) ;
ActorBox - > Enable ( state ) ;
ByTime - > Enable ( state ) ;
2006-03-20 22:48:01 +01:00
//SyntaxHighlight->Enable(state);
2006-01-16 22:02:54 +01:00
Bold - > Enable ( state ) ;
Italics - > Enable ( state ) ;
Underline - > Enable ( state ) ;
Strikeout - > Enable ( state ) ;
Color1 - > Enable ( state ) ;
Color2 - > Enable ( state ) ;
Color3 - > Enable ( state ) ;
Color4 - > Enable ( state ) ;
FontName - > Enable ( state ) ;
2007-07-04 07:22:35 +02:00
CommitButton - > Enable ( state ) ;
2006-01-16 22:02:54 +01:00
UpdateFrameTiming ( ) ;
// Clear values if it's false
if ( state = = false ) {
2006-12-24 18:42:09 +01:00
TextEdit - > SetTextTo ( _T ( " " ) ) ;
2006-01-16 22:02:54 +01:00
StartTime - > SetTime ( 0 ) ;
EndTime - > SetTime ( 0 ) ;
2007-01-08 04:05:26 +01:00
Duration - > SetTime ( 0 ) ;
2006-01-16 22:02:54 +01:00
Layer - > SetValue ( _T ( " " ) ) ;
MarginL - > SetValue ( _T ( " " ) ) ;
MarginR - > SetValue ( _T ( " " ) ) ;
MarginV - > SetValue ( _T ( " " ) ) ;
2006-06-27 06:13:34 +02:00
Effect - > SetValue ( _T ( " " ) ) ;
2006-01-16 22:02:54 +01:00
CommentBox - > SetValue ( false ) ;
}
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Disables or enables frame timing
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : UpdateFrameTiming ( ) {
2010-07-08 06:29:04 +02:00
if ( VideoContext : : Get ( ) - > TimecodesLoaded ( ) ) ByFrame - > Enable ( enabled ) ;
2006-01-16 22:02:54 +01:00
else {
ByFrame - > Enable ( false ) ;
ByTime - > SetValue ( true ) ;
StartTime - > SetByFrame ( false ) ;
EndTime - > SetByFrame ( false ) ;
grid - > SetByFrame ( false ) ;
}
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Style changed
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnStyleChange ( wxCommandEvent & event ) {
grid - > BeginBatch ( ) ;
wxArrayInt sel = grid - > GetSelection ( ) ;
int n = sel . Count ( ) ;
AssDialogue * cur ;
for ( int i = 0 ; i < n ; i + + ) {
cur = grid - > GetDialogue ( sel [ i ] ) ;
if ( cur ) {
cur - > Style = StyleBox - > GetValue ( ) ;
}
}
2010-07-09 09:31:34 +02:00
grid - > ass - > Commit ( _ ( " style change " ) ) ;
2006-01-16 22:02:54 +01:00
grid - > CommitChanges ( ) ;
grid - > EndBatch ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Style changed
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnActorChange ( wxCommandEvent & event ) {
grid - > BeginBatch ( ) ;
wxArrayInt sel = grid - > GetSelection ( ) ;
AssDialogue * cur ;
wxString actor = ActorBox - > GetValue ( ) ;
// Update rows
int n = sel . Count ( ) ;
for ( int i = 0 ; i < n ; i + + ) {
cur = grid - > GetDialogue ( sel [ i ] ) ;
if ( cur ) {
cur - > Actor = actor ;
}
}
// Add actor to list
2006-02-20 22:32:58 +01:00
if ( ActorBox - > GetString ( 0 ) . IsEmpty ( ) ) ActorBox - > Delete ( 0 ) ;
2006-01-16 22:02:54 +01:00
if ( ActorBox - > FindString ( actor ) = = wxNOT_FOUND ) {
ActorBox - > Append ( actor ) ;
}
// Update grid
2010-07-09 09:31:34 +02:00
grid - > ass - > Commit ( _ ( " actor change " ) ) ;
2006-01-16 22:02:54 +01:00
grid - > CommitChanges ( ) ;
grid - > EndBatch ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Layer changed with spin
/// @param event
///
2007-06-18 01:49:51 +02:00
void SubsEditBox : : OnLayerChange ( wxSpinEvent & event ) {
2006-12-30 15:31:41 +01:00
// Value
2007-06-18 01:49:51 +02:00
long temp = event . GetPosition ( ) ;
2006-12-30 15:31:41 +01:00
// Get selection
2006-01-16 22:02:54 +01:00
wxArrayInt sel = grid - > GetSelection ( ) ;
2006-12-30 15:31:41 +01:00
// Update
2006-01-16 22:02:54 +01:00
int n = sel . Count ( ) ;
AssDialogue * cur ;
for ( int i = 0 ; i < n ; i + + ) {
cur = grid - > GetDialogue ( sel [ i ] ) ;
if ( cur ) {
cur - > Layer = temp ;
}
}
2006-12-30 15:31:41 +01:00
// Done
2010-07-09 09:31:34 +02:00
grid - > ass - > Commit ( _ ( " layer change " ) ) ;
2007-10-29 16:30:04 +01:00
grid - > CommitChanges ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Layer changed with enter
/// @param event
///
2007-10-29 16:30:04 +01:00
void SubsEditBox : : OnLayerEnter ( wxCommandEvent & event ) {
// Value
long temp = Layer - > GetValue ( ) ;
// Get selection
wxArrayInt sel = grid - > GetSelection ( ) ;
// Update
int n = sel . Count ( ) ;
AssDialogue * cur ;
for ( int i = 0 ; i < n ; i + + ) {
cur = grid - > GetDialogue ( sel [ i ] ) ;
if ( cur ) {
cur - > Layer = temp ;
}
}
// Done
2010-07-09 09:31:34 +02:00
grid - > ass - > Commit ( _ ( " layer change " ) ) ;
2006-01-16 22:02:54 +01:00
grid - > CommitChanges ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Start time changed
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnStartTimeChange ( wxCommandEvent & event ) {
if ( StartTime - > time > EndTime - > time ) StartTime - > SetTime ( EndTime - > time . GetMS ( ) ) ;
2010-05-21 03:13:36 +02:00
bool join = OPT_GET ( " Subtitle/Edit Box/Link Time Boxes Commit " ) - > GetBool ( ) & & EndTime - > HasBeenModified ( ) ;
2006-01-16 22:02:54 +01:00
StartTime - > Update ( ) ;
2007-04-25 06:31:36 +02:00
Duration - > Update ( ) ;
2006-01-16 22:02:54 +01:00
if ( join ) EndTime - > Update ( ) ;
2006-02-19 04:33:13 +01:00
CommitTimes ( true , join , true ) ;
2006-01-16 22:02:54 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief End time changed
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnEndTimeChange ( wxCommandEvent & event ) {
if ( StartTime - > time > EndTime - > time ) EndTime - > SetTime ( StartTime - > time . GetMS ( ) ) ;
2010-05-21 03:13:36 +02:00
bool join = OPT_GET ( " Subtitle/Edit Box/Link Time Boxes Commit " ) - > GetBool ( ) & & StartTime - > HasBeenModified ( ) ;
2006-01-16 22:02:54 +01:00
EndTime - > Update ( ) ;
2007-04-25 06:31:36 +02:00
Duration - > Update ( ) ;
2006-01-16 22:02:54 +01:00
if ( join ) StartTime - > Update ( ) ;
2006-02-19 04:33:13 +01:00
CommitTimes ( join , true , false ) ;
2006-01-16 22:02:54 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Duration changed
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnDurationChange ( wxCommandEvent & event ) {
EndTime - > SetTime ( StartTime - > time . GetMS ( ) + Duration - > time . GetMS ( ) ) ;
2007-04-25 06:31:36 +02:00
StartTime - > Update ( ) ;
EndTime - > Update ( ) ;
2006-01-16 22:02:54 +01:00
Duration - > Update ( ) ;
2006-02-19 04:33:13 +01:00
CommitTimes ( false , true , true ) ;
2006-01-16 22:02:54 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Commit time changes
/// @param start
/// @param end
/// @param fromStart
/// @param commit
/// @return
///
2007-04-25 06:31:36 +02:00
void SubsEditBox : : CommitTimes ( bool start , bool end , bool fromStart , bool commit ) {
2006-01-16 22:02:54 +01:00
// Get selection
if ( ! start & & ! end ) return ;
2010-06-26 13:32:16 +02:00
Selection sel ;
grid - > GetSelectedSet ( sel ) ;
if ( sel . size ( ) = = 0 ) return ;
2006-01-16 22:02:54 +01:00
AssDialogue * cur ;
Duration - > SetTime ( EndTime - > time . GetMS ( ) - StartTime - > time . GetMS ( ) ) ;
// Update lines
2010-06-26 13:32:16 +02:00
for ( Selection : : iterator it = sel . begin ( ) ; it ! = sel . end ( ) ; + + it ) {
if ( sel . find ( grid - > GetActiveLine ( ) ) ! = sel . end ( ) ) cur = * it ;
else cur = grid - > GetActiveLine ( ) ;
2006-01-16 22:02:54 +01:00
if ( cur ) {
2006-02-19 04:33:13 +01:00
// Set times
2006-01-16 22:02:54 +01:00
if ( start ) cur - > Start = StartTime - > time ;
if ( end ) cur - > End = EndTime - > time ;
2006-02-19 04:33:13 +01:00
// Ensure that they have positive length
if ( cur - > Start > cur - > End ) {
if ( fromStart ) cur - > End = cur - > Start ;
else cur - > Start = cur - > End ;
}
2010-06-26 13:32:16 +02:00
if ( sel . find ( grid - > GetActiveLine ( ) ) = = sel . end ( ) ) break ;
2006-01-16 22:02:54 +01:00
}
}
// Commit
2007-04-25 06:31:36 +02:00
if ( commit ) {
2009-04-26 03:02:23 +02:00
StartTime - > Update ( ) ;
EndTime - > Update ( ) ;
Duration - > Update ( ) ;
2010-07-09 09:31:34 +02:00
grid - > ass - > Commit ( _ ( " modify times " ) ) ;
2007-04-25 06:31:36 +02:00
grid - > CommitChanges ( ) ;
2010-06-26 13:32:16 +02:00
int sel0 = grid - > GetFirstSelRow ( ) ;
audio - > SetDialogue ( grid , grid - > GetDialogue ( sel0 ) , sel0 ) ;
2007-04-25 06:31:36 +02:00
VideoContext : : Get ( ) - > UpdateDisplays ( false ) ;
}
2006-01-16 22:02:54 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Margin L changed
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnMarginLChange ( wxCommandEvent & event ) {
MarginL - > Commited ( ) ;
grid - > BeginBatch ( ) ;
wxArrayInt sel = grid - > GetSelection ( ) ;
int n = sel . Count ( ) ;
2007-01-24 04:54:32 +01:00
AssDialogue * cur = NULL ;
2006-01-16 22:02:54 +01:00
for ( int i = 0 ; i < n ; i + + ) {
cur = grid - > GetDialogue ( sel [ i ] ) ;
if ( cur ) {
2007-01-05 19:27:15 +01:00
cur - > SetMarginString ( MarginL - > GetValue ( ) , 0 ) ;
2006-01-16 22:02:54 +01:00
}
}
2007-01-05 19:27:15 +01:00
MarginL - > SetValue ( cur - > GetMarginString ( 0 , false ) ) ;
2010-07-09 09:31:34 +02:00
grid - > ass - > Commit ( _ ( " MarginL change " ) ) ;
2006-01-16 22:02:54 +01:00
grid - > CommitChanges ( ) ;
grid - > EndBatch ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Margin R changed
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnMarginRChange ( wxCommandEvent & event ) {
MarginR - > Commited ( ) ;
grid - > BeginBatch ( ) ;
wxArrayInt sel = grid - > GetSelection ( ) ;
int n = sel . Count ( ) ;
2007-01-24 04:54:32 +01:00
AssDialogue * cur = NULL ;
2006-01-16 22:02:54 +01:00
for ( int i = 0 ; i < n ; i + + ) {
cur = grid - > GetDialogue ( sel [ i ] ) ;
if ( cur ) {
2007-01-05 19:27:15 +01:00
cur - > SetMarginString ( MarginR - > GetValue ( ) , 1 ) ;
2006-01-16 22:02:54 +01:00
}
}
2007-01-05 19:27:15 +01:00
MarginR - > SetValue ( cur - > GetMarginString ( 1 , false ) ) ;
2010-07-09 09:31:34 +02:00
grid - > ass - > Commit ( _ ( " MarginR change " ) ) ;
2006-01-16 22:02:54 +01:00
grid - > CommitChanges ( ) ;
grid - > EndBatch ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Margin V changed
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnMarginVChange ( wxCommandEvent & event ) {
MarginV - > Commited ( ) ;
grid - > BeginBatch ( ) ;
wxArrayInt sel = grid - > GetSelection ( ) ;
int n = sel . Count ( ) ;
2007-01-24 04:54:32 +01:00
AssDialogue * cur = NULL ;
2006-01-16 22:02:54 +01:00
for ( int i = 0 ; i < n ; i + + ) {
cur = grid - > GetDialogue ( sel [ i ] ) ;
if ( cur ) {
2007-01-05 19:27:15 +01:00
cur - > SetMarginString ( MarginV - > GetValue ( ) , 2 ) ;
2007-04-01 14:21:16 +02:00
cur - > SetMarginString ( MarginV - > GetValue ( ) , 3 ) ; // also bottom margin for now
2006-01-16 22:02:54 +01:00
}
}
2007-01-05 19:27:15 +01:00
MarginV - > SetValue ( cur - > GetMarginString ( 2 , false ) ) ;
2010-07-09 09:31:34 +02:00
grid - > ass - > Commit ( _ ( " MarginV change " ) ) ;
2006-01-16 22:02:54 +01:00
grid - > CommitChanges ( ) ;
grid - > EndBatch ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Effect changed
/// @param event
///
2006-06-27 06:13:34 +02:00
void SubsEditBox : : OnEffectChange ( wxCommandEvent & event ) {
Effect - > Commited ( ) ;
grid - > BeginBatch ( ) ;
wxArrayInt sel = grid - > GetSelection ( ) ;
int n = sel . Count ( ) ;
AssDialogue * cur ;
for ( int i = 0 ; i < n ; i + + ) {
cur = grid - > GetDialogue ( sel [ i ] ) ;
if ( cur ) {
cur - > Effect = Effect - > GetValue ( ) ;
}
}
2010-07-09 09:31:34 +02:00
grid - > ass - > Commit ( _ ( " effect change " ) ) ;
2006-06-27 06:13:34 +02:00
grid - > CommitChanges ( ) ;
grid - > EndBatch ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Comment state changed
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnCommentChange ( wxCommandEvent & event ) {
grid - > BeginBatch ( ) ;
wxArrayInt sel = grid - > GetSelection ( ) ;
int n = sel . Count ( ) ;
AssDialogue * cur ;
for ( int i = 0 ; i < n ; i + + ) {
cur = grid - > GetDialogue ( sel [ i ] ) ;
if ( cur ) {
cur - > Comment = CommentBox - > GetValue ( ) ;
}
}
2010-07-09 09:31:34 +02:00
grid - > ass - > Commit ( _ ( " comment change " ) ) ;
2006-01-16 22:02:54 +01:00
grid - > CommitChanges ( ) ;
grid - > EndBatch ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Event handler class
/// @param _control
///
2006-01-16 22:02:54 +01:00
SubsEditBoxEvent : : SubsEditBoxEvent ( SubsEditBox * _control ) {
control = _control ;
}
BEGIN_EVENT_TABLE ( SubsEditBoxEvent , wxEvtHandler )
EVT_KEY_DOWN ( SubsEditBoxEvent : : OnKeyPress )
END_EVENT_TABLE ( )
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief DOCME
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBoxEvent : : OnKeyPress ( wxKeyEvent & event ) {
2007-01-24 03:25:45 +01:00
control - > DoKeyPress ( event ) ;
2006-01-16 22:02:54 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Actual text changed
/// @param event
/// @return
///
2007-01-24 03:25:45 +01:00
void SubsEditBox : : DoKeyPress ( wxKeyEvent & event ) {
2006-01-16 22:02:54 +01:00
int key = event . GetKeyCode ( ) ;
if ( key = = WXK_RETURN | | key = = WXK_NUMPAD_ENTER ) {
if ( enabled ) {
2007-09-22 00:56:44 +02:00
# ifdef __APPLE__
Commit ( event . m_metaDown ) ;
# else
2007-06-30 22:00:07 +02:00
Commit ( event . m_controlDown ) ;
2007-09-22 00:56:44 +02:00
# endif
2006-01-16 22:02:54 +01:00
return ;
}
}
event . Skip ( ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Commit
/// @param stay
/// @return
///
2007-06-30 22:00:07 +02:00
void SubsEditBox : : Commit ( bool stay ) {
2009-04-26 03:02:23 +02:00
// Record pre-commit data
2010-06-26 13:32:16 +02:00
AssDialogue * old_line = grid - > GetActiveLine ( ) ;
wxString oldText = old_line - > Text ;
int oldStart = old_line - > Start . GetMS ( ) ;
int oldEnd = old_line - > End . GetMS ( ) ;
2007-06-30 22:00:07 +02:00
// Update line
CommitText ( ) ;
2009-04-26 03:02:23 +02:00
// Change text/time if needed for all selected lines
2010-06-26 13:32:16 +02:00
bool textNeedsCommit = old_line - > Text ! = oldText ;
bool timeNeedsCommit = old_line - > Start . GetMS ( ) ! = oldStart | | old_line - > End . GetMS ( ) ! = oldEnd ;
Selection sel ;
grid - > GetSelectedSet ( sel ) ;
if ( sel . find ( old_line ) ! = sel . end ( ) ) {
for ( Selection : : iterator it = sel . begin ( ) ; it ! = sel . end ( ) ; + + it ) {
if ( textNeedsCommit ) {
( * it ) - > Text = TextEdit - > GetText ( ) ;
}
2009-04-26 03:02:23 +02:00
if ( timeNeedsCommit ) {
2010-06-26 13:32:16 +02:00
( * it ) - > Start . SetMS ( StartTime - > time . GetMS ( ) ) ;
( * it ) - > End . SetMS ( EndTime - > time . GetMS ( ) ) ;
2009-04-26 03:02:23 +02:00
}
}
}
// Update file
2010-06-26 13:32:16 +02:00
if ( textNeedsCommit ) {
2010-07-09 09:31:34 +02:00
grid - > ass - > Commit ( _ ( " editing " ) ) ;
2009-04-26 03:02:23 +02:00
grid - > CommitChanges ( ) ;
}
2010-06-26 13:32:16 +02:00
else if ( StartTime - > HasBeenModified ( ) | | EndTime - > HasBeenModified ( ) ) {
2009-04-26 03:02:23 +02:00
CommitTimes ( StartTime - > HasBeenModified ( ) , EndTime - > HasBeenModified ( ) , StartTime - > HasBeenModified ( ) , true ) ;
2010-06-26 13:32:16 +02:00
}
2009-04-26 03:02:23 +02:00
// Get next line if ctrl was not held down
2007-06-30 22:00:07 +02:00
if ( ! stay ) {
2009-04-26 03:02:23 +02:00
int next ;
2010-06-26 13:32:16 +02:00
if ( sel . find ( old_line ) = = sel . end ( ) )
next = grid - > GetDialogueIndex ( old_line ) + 1 ;
else
next = grid - > GetLastSelRow ( ) + 1 ;
2009-04-26 03:02:23 +02:00
AssDialogue * cur = grid - > GetDialogue ( next - 1 ) ;
2010-06-26 13:32:16 +02:00
if ( next > = grid - > GetRows ( ) ) {
2007-06-30 22:00:07 +02:00
AssDialogue * newline = new AssDialogue ;
newline - > Start = cur - > End ;
2010-05-21 03:13:36 +02:00
newline - > End . SetMS ( cur - > End . GetMS ( ) + OPT_GET ( " Timing/Default Duration " ) - > GetInt ( ) ) ;
2007-06-30 22:00:07 +02:00
newline - > Style = cur - > Style ;
grid - > InsertLine ( newline , next - 1 , true , true ) ;
}
grid - > SelectRow ( next ) ;
grid - > MakeCellVisible ( next , 0 ) ;
2010-06-26 13:32:16 +02:00
grid - > SetActiveLine ( grid - > GetDialogue ( next ) ) ;
2007-06-30 22:00:07 +02:00
}
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Commit text
/// @param weak
///
2007-01-08 06:32:29 +01:00
void SubsEditBox : : CommitText ( bool weak ) {
2010-06-26 13:32:16 +02:00
AssDialogue * cur = grid - > GetActiveLine ( ) ;
2006-01-16 22:02:54 +01:00
// Update line
if ( cur ) {
2007-04-25 06:31:36 +02:00
// Update text
2006-12-24 05:54:35 +01:00
cur - > Text = TextEdit - > GetText ( ) ;
2007-04-25 06:31:36 +02:00
// Update times
2010-06-26 13:32:16 +02:00
if ( grid - > IsInSelection ( grid - > GetDialogueIndex ( cur ) ) ) {
2009-04-26 03:02:23 +02:00
cur - > Start = StartTime - > time ;
cur - > End = EndTime - > time ;
if ( cur - > Start > cur - > End ) {
cur - > End = cur - > Start ;
EndTime - > SetTime ( cur - > End . GetMS ( ) ) ;
}
}
2007-04-25 06:31:36 +02:00
// Update audio
2007-01-08 06:32:29 +01:00
if ( ! weak ) {
grid - > Refresh ( false ) ;
2010-06-26 13:32:16 +02:00
audio - > SetDialogue ( grid , cur , grid - > GetDialogueIndex ( cur ) ) ;
2007-01-08 06:32:29 +01:00
}
2006-01-16 22:02:54 +01:00
}
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Gets block number at text position
/// @param pos
/// @return
///
2006-01-16 22:02:54 +01:00
int SubsEditBox : : BlockAtPos ( int pos ) {
// Prepare
int n = 0 ;
2006-12-24 05:54:35 +01:00
wxString text = TextEdit - > GetText ( ) ; ;
2006-01-16 22:02:54 +01:00
int max = text . Length ( ) - 1 ;
// Find block number at pos
2007-01-29 06:47:29 +01:00
for ( int i = 0 ; i < = pos & & i < = max ; i + + ) {
2006-01-16 22:02:54 +01:00
if ( i > 0 & & text [ i ] = = _T ( ' { ' ) ) n + + ;
if ( text [ i ] = = _T ( ' } ' ) & & i ! = max & & i ! = pos & & i ! = pos - 1 & & ( i + 1 = = max | | text [ i + 1 ] ! = _T ( ' { ' ) ) ) n + + ;
}
return n ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Set override
/// @param tagname
/// @param preValue
/// @param forcePos
/// @param getFocus
/// @return
///
2007-01-23 05:42:08 +01:00
void SubsEditBox : : SetOverride ( wxString tagname , wxString preValue , int forcePos , bool getFocus ) {
2006-01-16 22:02:54 +01:00
// Selection
2006-12-24 05:54:35 +01:00
int selstart , selend ;
2006-01-16 22:02:54 +01:00
if ( forcePos ! = - 1 ) {
selstart = forcePos ;
selend = forcePos ;
}
else TextEdit - > GetSelection ( & selstart , & selend ) ;
2006-12-24 05:54:35 +01:00
int len = TextEdit - > GetText ( ) . Length ( ) ;
2008-03-06 20:53:45 +01:00
selstart = MID ( 0 , TextEdit - > GetReverseUnicodePosition ( selstart ) , len ) ;
selend = MID ( 0 , TextEdit - > GetReverseUnicodePosition ( selend ) , len ) ;
2006-02-19 05:55:10 +01:00
// Current tag name
wxString alttagname = tagname ;
2007-07-04 02:36:04 +02:00
wxString removeTag ;
2006-02-19 05:55:10 +01:00
if ( tagname = = _T ( " \\ 1c " ) ) tagname = _T ( " \\ c " ) ;
2007-01-10 05:33:03 +01:00
if ( tagname = = _T ( " \\ fr " ) ) tagname = _T ( " \\ frz " ) ;
2007-07-04 02:36:04 +02:00
if ( tagname = = _T ( " \\ pos " ) ) removeTag = _T ( " \\ move " ) ;
if ( tagname = = _T ( " \\ move " ) ) removeTag = _T ( " \\ pos " ) ;
2006-01-16 22:02:54 +01:00
// Get block at start
size_t blockn = BlockAtPos ( selstart ) ;
AssDialogue * line = new AssDialogue ( ) ;
2006-12-24 05:54:35 +01:00
line - > Text = TextEdit - > GetText ( ) ;
2006-01-16 22:02:54 +01:00
line - > ParseASSTags ( ) ;
AssDialogueBlock * block = line - > Blocks . at ( blockn ) ;
2006-02-19 05:55:10 +01:00
// Insert variables
wxString insert ;
wxString insert2 ;
2007-01-24 04:54:32 +01:00
int shift = 0 ;
2006-07-13 04:10:19 +02:00
int nInserted = 1 ;
2006-01-16 22:02:54 +01:00
2006-02-19 05:55:10 +01:00
// Default value
wxColour startcolor ;
2006-02-21 23:46:18 +01:00
wxFont startfont ;
2006-01-16 22:02:54 +01:00
bool isColor = false ;
bool isFont = false ;
2007-01-10 22:53:00 +01:00
bool isGeneric = false ;
2006-02-19 05:55:10 +01:00
bool isFlag = false ;
bool state = false ;
2010-06-26 13:32:16 +02:00
AssStyle * style = grid - > ass - > GetStyle ( grid - > GetActiveLine ( ) - > Style ) ;
2006-01-16 22:02:54 +01:00
AssStyle defStyle ;
if ( style = = NULL ) style = & defStyle ;
2006-02-19 05:55:10 +01:00
if ( tagname = = _T ( " \\ b " ) ) {
state = style - > bold ;
isFlag = true ;
}
else if ( tagname = = _T ( " \\ i " ) ) {
state = style - > italic ;
isFlag = true ;
}
else if ( tagname = = _T ( " \\ u " ) ) {
state = style - > underline ;
isFlag = true ;
}
else if ( tagname = = _T ( " \\ s " ) ) {
state = style - > strikeout ;
isFlag = true ;
}
else if ( tagname = = _T ( " \\ fn " ) ) {
2006-02-21 23:46:18 +01:00
startfont . SetFaceName ( style - > font ) ;
2007-04-04 22:42:44 +02:00
startfont . SetPointSize ( int ( style - > fontsize ) ) ;
2006-02-21 23:46:18 +01:00
startfont . SetWeight ( style - > bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL ) ;
startfont . SetStyle ( style - > italic ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL ) ;
startfont . SetUnderlined ( style - > underline ) ;
2006-02-19 05:55:10 +01:00
isFont = true ;
}
else if ( tagname = = _T ( " \\ c " ) ) {
2006-01-16 22:02:54 +01:00
startcolor = style - > primary . GetWXColor ( ) ;
isColor = true ;
}
else if ( tagname = = _T ( " \\ 2c " ) ) {
startcolor = style - > secondary . GetWXColor ( ) ;
isColor = true ;
}
else if ( tagname = = _T ( " \\ 3c " ) ) {
startcolor = style - > outline . GetWXColor ( ) ;
isColor = true ;
}
else if ( tagname = = _T ( " \\ 4c " ) ) {
startcolor = style - > shadow . GetWXColor ( ) ;
isColor = true ;
}
2007-07-04 02:36:04 +02:00
else isGeneric = true ;
2006-02-19 05:55:10 +01:00
bool hasEnd = isFlag ;
2006-01-16 22:02:54 +01:00
2006-02-19 05:55:10 +01:00
// Find current value of style
2006-01-16 22:02:54 +01:00
AssDialogueBlockOverride * override ;
AssOverrideTag * tag ;
2009-07-28 01:55:17 +02:00
if ( isFont | | isColor | | isFlag ) {
2006-01-16 22:02:54 +01:00
for ( size_t i = 0 ; i < = blockn ; i + + ) {
2010-06-04 05:07:52 +02:00
override = dynamic_cast < AssDialogueBlockOverride * > ( line - > Blocks . at ( i ) ) ;
2006-01-16 22:02:54 +01:00
if ( override ) {
for ( size_t j = 0 ; j < override - > Tags . size ( ) ; j + + ) {
tag = override - > Tags . at ( j ) ;
2006-02-21 23:46:18 +01:00
if ( tag - > Name = = tagname | | tag - > Name = = alttagname | | tagname = = _T ( " \\ fn " ) ) {
2010-06-16 08:20:06 +02:00
if ( isColor ) startcolor = tag - > Params . at ( 0 ) - > Get < wxColour > ( ) ;
if ( isFlag ) state = tag - > Params . at ( 0 ) - > Get < bool > ( ) ;
2006-02-21 23:32:51 +01:00
if ( isFont ) {
2010-06-16 08:20:06 +02:00
if ( tag - > Name = = _T ( " \\ fn " ) ) startfont . SetFaceName ( tag - > Params . at ( 0 ) - > Get < wxString > ( ) ) ;
if ( tag - > Name = = _T ( " \\ fs " ) ) startfont . SetPointSize ( tag - > Params . at ( 0 ) - > Get < int > ( ) ) ;
if ( tag - > Name = = _T ( " \\ b " ) ) startfont . SetWeight ( ( tag - > Params . at ( 0 ) - > Get < int > ( ) > 0 ) ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL ) ;
if ( tag - > Name = = _T ( " \\ i " ) ) startfont . SetStyle ( tag - > Params . at ( 0 ) - > Get < bool > ( ) ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL ) ;
if ( tag - > Name = = _T ( " \\ u " ) ) startfont . SetUnderlined ( tag - > Params . at ( 0 ) - > Get < bool > ( ) ) ;
2006-02-21 23:32:51 +01:00
}
2006-01-16 22:02:54 +01:00
}
}
}
}
}
2007-01-15 20:44:48 +01:00
// Overrides being inserted
wxArrayString insertTags ;
2006-02-19 05:55:10 +01:00
// Toggle value
if ( isFlag ) {
state = ! state ;
int stateval = 0 ;
if ( state ) stateval = 1 ;
// Generate insert string
insert = tagname + wxString : : Format ( _T ( " %i " ) , stateval ) ;
insert2 = tagname + wxString : : Format ( _T ( " %i " ) , 1 - stateval ) ;
2007-01-15 20:44:48 +01:00
insertTags . Add ( tagname ) ;
2006-02-19 05:55:10 +01:00
}
2006-01-16 22:02:54 +01:00
// Choose color
if ( isColor ) {
// Pick from dialog
//wxColour color = wxGetColourFromUser(this,startcolor);
2006-02-19 05:55:10 +01:00
wxColour color = GetColorFromUser ( ( ( AegisubApp * ) wxTheApp ) - > frame , startcolor ) ;
2007-01-15 07:56:35 +01:00
if ( ! color . Ok ( ) | | color = = startcolor ) {
delete line ;
return ;
}
2006-01-16 22:02:54 +01:00
// Generate insert string
AssColor asscolor ( color ) ;
insert = tagname + asscolor . GetASSFormatted ( false ) ;
2007-01-15 20:44:48 +01:00
insertTags . Add ( tagname ) ;
2006-01-16 22:02:54 +01:00
}
// Choose font
if ( isFont ) {
// Pick from dialog
2006-02-21 23:46:18 +01:00
wxFont font = wxGetFontFromUser ( this , startfont ) ;
2007-01-15 07:56:35 +01:00
if ( ! font . Ok ( ) ) {
delete line ;
return ;
}
2006-01-16 22:02:54 +01:00
// Generate insert string
2006-07-13 04:10:19 +02:00
nInserted = 0 ;
if ( font . GetFaceName ( ) ! = startfont . GetFaceName ( ) ) {
insert = _T ( " \\ fn " ) + font . GetFaceName ( ) ;
nInserted + + ;
2007-01-15 20:44:48 +01:00
insertTags . Add ( _T ( " \\ fn " ) ) ;
2006-07-13 04:10:19 +02:00
}
if ( font . GetPointSize ( ) ! = startfont . GetPointSize ( ) ) {
insert + = _T ( " \\ fs " ) + wxString : : Format ( _T ( " %i " ) , font . GetPointSize ( ) ) ;
nInserted + + ;
2007-01-15 20:44:48 +01:00
insertTags . Add ( _T ( " \\ fs " ) ) ;
2006-07-13 04:10:19 +02:00
}
if ( font . GetWeight ( ) ! = startfont . GetWeight ( ) ) {
insert + = _T ( " \\ b " ) + wxString : : Format ( _T ( " %i " ) , font . GetWeight ( ) = = wxFONTWEIGHT_BOLD ? 1 : 0 ) ;
nInserted + + ;
2007-01-15 20:44:48 +01:00
insertTags . Add ( _T ( " \\ b " ) ) ;
2006-07-13 04:10:19 +02:00
}
if ( font . GetStyle ( ) ! = startfont . GetStyle ( ) ) {
insert + = _T ( " \\ i " ) + wxString : : Format ( _T ( " %i " ) , font . GetStyle ( ) = = wxFONTSTYLE_ITALIC ? 1 : 0 ) ;
nInserted + + ;
2007-01-15 20:44:48 +01:00
insertTags . Add ( _T ( " \\ i " ) ) ;
2006-07-13 04:10:19 +02:00
}
if ( font . GetUnderlined ( ) ! = startfont . GetUnderlined ( ) ) {
insert + = _T ( " \\ u " ) + wxString : : Format ( _T ( " %i " ) , font . GetUnderlined ( ) ? 1 : 0 ) ;
nInserted + + ;
2007-01-15 20:44:48 +01:00
insertTags . Add ( _T ( " \\ u " ) ) ;
2006-07-13 04:10:19 +02:00
}
2007-01-15 07:56:35 +01:00
if ( insert . IsEmpty ( ) ) {
delete line ;
return ;
}
2006-01-16 22:02:54 +01:00
}
2007-01-10 22:53:00 +01:00
// Generic tag
if ( isGeneric ) {
2006-01-16 22:02:54 +01:00
insert = tagname + preValue ;
2007-01-15 20:44:48 +01:00
insertTags . Add ( tagname ) ;
2006-01-16 22:02:54 +01:00
}
// Get current block as plain or override
2010-06-04 05:07:52 +02:00
AssDialogueBlockPlain * plain = dynamic_cast < AssDialogueBlockPlain * > ( block ) ;
override = dynamic_cast < AssDialogueBlockOverride * > ( block ) ;
2006-01-16 22:02:54 +01:00
// Plain
if ( plain ) {
// Insert in text
line - > Text = line - > Text . Left ( selstart ) + _T ( " { " ) + insert + _T ( " } " ) + line - > Text . Mid ( selstart ) ;
shift = 2 + insert . Length ( ) ;
line - > ParseASSTags ( ) ;
}
// Override
else if ( override ) {
// Insert new tag
override - > text + = insert ;
override - > ParseTags ( ) ;
shift = insert . Length ( ) ;
// Remove old of same
2006-07-13 04:10:19 +02:00
for ( size_t i = 0 ; i < override - > Tags . size ( ) - nInserted ; i + + ) {
2007-01-15 20:44:48 +01:00
//if (insert.Contains(override->Tags.at(i)->Name)) {
2007-07-04 02:36:04 +02:00
wxString name = override - > Tags . at ( i ) - > Name ;
if ( insertTags . Index ( name ) ! = wxNOT_FOUND | | removeTag = = name ) {
2010-06-24 03:24:43 +02:00
shift - = ( ( wxString ) * override - > Tags . at ( i ) ) . Length ( ) ;
2009-06-10 05:32:18 +02:00
delete override - > Tags . at ( i ) ;
2006-01-16 22:02:54 +01:00
override - > Tags . erase ( override - > Tags . begin ( ) + i ) ;
i - - ;
}
}
// Update line
line - > UpdateText ( ) ;
}
// End
if ( hasEnd & & selend ! = selstart ) {
// Prepare variables again
2006-02-19 06:10:57 +01:00
int origStart = selstart ;
selstart = selend + shift ;
2006-01-16 22:02:54 +01:00
insert = insert2 ;
2006-12-24 18:42:09 +01:00
TextEdit - > SetTextTo ( line - > Text ) ;
2006-02-19 06:10:57 +01:00
blockn = BlockAtPos ( selstart ) ;
2006-01-16 22:02:54 +01:00
block = line - > Blocks . at ( blockn ) ;
2010-06-04 05:07:52 +02:00
plain = dynamic_cast < AssDialogueBlockPlain * > ( block ) ;
override = dynamic_cast < AssDialogueBlockOverride * > ( block ) ;
2006-01-16 22:02:54 +01:00
// Plain
if ( plain ) {
// Insert in text
line - > Text = line - > Text . Left ( selstart ) + _T ( " { " ) + insert + _T ( " } " ) + line - > Text . Mid ( selstart ) ;
}
// Override
else if ( override ) {
// Insert new tag
override - > text + = insert ;
override - > ParseTags ( ) ;
// Remove old of same
2006-07-13 04:10:19 +02:00
for ( size_t i = 0 ; i < override - > Tags . size ( ) - nInserted ; i + + ) {
2007-07-04 02:36:04 +02:00
wxString name = override - > Tags . at ( i ) - > Name ;
if ( insert . Contains ( name ) | | removeTag = = name ) {
2010-06-24 03:24:43 +02:00
shift - = ( ( wxString ) * override - > Tags . at ( i ) ) . Length ( ) ;
2006-01-16 22:02:54 +01:00
override - > Tags . erase ( override - > Tags . begin ( ) + i ) ;
i - - ;
}
}
// Update line
line - > UpdateText ( ) ;
}
// Shift selection
2006-02-19 05:55:10 +01:00
selstart = origStart ;
2006-12-26 02:20:58 +01:00
TextEdit - > SetSelectionU ( origStart + shift , selend + shift ) ;
2006-01-16 22:02:54 +01:00
}
2006-02-19 05:55:10 +01:00
// Commit changes and shift selection
2006-12-24 18:42:09 +01:00
TextEdit - > SetTextTo ( line - > Text ) ;
2007-01-15 07:56:35 +01:00
delete line ;
2006-12-26 02:20:58 +01:00
TextEdit - > SetSelectionU ( selstart + shift , selend + shift ) ;
2007-01-23 05:42:08 +01:00
if ( getFocus ) TextEdit - > SetFocus ( ) ;
2006-01-16 22:02:54 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Set primary color
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnButtonColor1 ( wxCommandEvent & event ) {
SetOverride ( _T ( " \\ 1c " ) ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Set secondary color
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnButtonColor2 ( wxCommandEvent & event ) {
SetOverride ( _T ( " \\ 2c " ) ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Set outline color
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnButtonColor3 ( wxCommandEvent & event ) {
SetOverride ( _T ( " \\ 3c " ) ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Set shadow color
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnButtonColor4 ( wxCommandEvent & event ) {
SetOverride ( _T ( " \\ 4c " ) ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Set font face
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnButtonFontFace ( wxCommandEvent & event ) {
SetOverride ( _T ( " \\ fn " ) ) ;
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Bold
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnButtonBold ( wxCommandEvent & event ) {
2006-02-19 05:55:10 +01:00
SetOverride ( _T ( " \\ b " ) ) ;
2006-01-16 22:02:54 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Italics
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnButtonItalics ( wxCommandEvent & event ) {
2006-02-19 05:55:10 +01:00
SetOverride ( _T ( " \\ i " ) ) ;
2006-01-16 22:02:54 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Underline
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnButtonUnderline ( wxCommandEvent & event ) {
2006-02-19 05:55:10 +01:00
SetOverride ( _T ( " \\ u " ) ) ;
2006-01-16 22:02:54 +01:00
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Strikeout
/// @param event
///
2006-01-16 22:02:54 +01:00
void SubsEditBox : : OnButtonStrikeout ( wxCommandEvent & event ) {
2006-02-19 05:55:10 +01:00
SetOverride ( _T ( " \\ s " ) ) ;
2006-01-16 22:02:54 +01:00
}
2007-01-29 06:47:29 +01:00
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
/// @brief Commit
/// @param event
///
2007-06-30 22:00:07 +02:00
void SubsEditBox : : OnButtonCommit ( wxCommandEvent & event ) {
2007-09-22 00:56:44 +02:00
# ifdef __APPLE__
2007-09-22 17:16:48 +02:00
Commit ( wxGetMouseState ( ) . CmdDown ( ) ) ;
2007-09-22 00:56:44 +02:00
# else
2007-09-22 17:16:48 +02:00
Commit ( wxGetMouseState ( ) . ControlDown ( ) ) ;
2007-09-22 00:56:44 +02:00
# endif
2007-06-30 22:00:07 +02:00
}
2007-07-03 08:43:57 +02:00
2009-07-29 07:43:02 +02:00
2010-06-26 13:32:16 +02:00
void SubsEditBox : : OnActiveLineChanged ( AssDialogue * new_line ) {
// Set to nothing
enabled = ( new_line ! = 0 ) ;
// Set line
if ( enabled ) {
StartTime - > Update ( ) ;
EndTime - > Update ( ) ;
Duration - > Update ( ) ;
}
// Update controls
Update ( ) ;
// Set video
if ( VideoContext : : Get ( ) - > IsLoaded ( ) ) {
bool sync ;
if ( Search . hasFocus ) sync = OPT_GET ( " Tool/Search Replace/Video Update " ) - > GetBool ( ) ;
else sync = OPT_GET ( " Video/Subtitle Sync " ) - > GetBool ( ) ;
if ( sync ) {
VideoContext : : Get ( ) - > Stop ( ) ;
if ( new_line ) VideoContext : : Get ( ) - > JumpToTime ( new_line - > Start . GetMS ( ) ) ;
}
}
TextEdit - > EmptyUndoBuffer ( ) ;
}
void SubsEditBox : : OnSelectedSetChanged ( const Selection & lines_added , const Selection & lines_removed ) {
}
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00