Added icons to all dialogs that have one for them.

Originally committed to SVN as r1360.
This commit is contained in:
Rodrigo Braz Monteiro 2007-07-04 23:09:40 +00:00
parent 83d8d48db6
commit 6087d6ec22
17 changed files with 79 additions and 3 deletions

View File

@ -52,6 +52,9 @@
DialogAttachments::DialogAttachments(wxWindow *parent)
: wxDialog(parent,-1,_("Attachment List"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE)
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(attach_button)));
// List view
listView = new wxListView(this,ATTACHMENT_LIST,wxDefaultPosition,wxSize(500,200));
UpdateList();

View File

@ -37,6 +37,7 @@
#include "dialog_automation.h"
#include "auto4_base.h"
#include "options.h"
#include "utils.h"
#include <wx/filename.h>
#include <wx/filedlg.h>
@ -44,6 +45,9 @@
DialogAutomation::DialogAutomation(wxWindow *parent, Automation4::ScriptManager *_local_manager)
: wxDialog(parent, -1, _("Automation Manager"), wxDefaultPosition, wxDefaultSize)
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(automation_toolbutton)));
local_manager = _local_manager;
global_manager = wxGetApp().global_scripts;

View File

@ -68,6 +68,9 @@ enum IDs {
DialogFontsCollector::DialogFontsCollector(wxWindow *parent)
: wxDialog(parent,-1,_("Fonts Collector"),wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(font_collector_button)));
// Parent
main = (FrameMain*) parent;

View File

@ -39,6 +39,7 @@
#include "dialog_jumpto.h"
#include "vfr.h"
#include "video_context.h"
#include "utils.h"
///////
@ -54,6 +55,9 @@ enum {
DialogJumpTo::DialogJumpTo (wxWindow *parent)
: wxDialog(parent, -1, _("Jump to"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("JumpTo"))
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(jumpto_button)));
// Set initial values
ready = false;
jumpframe = VideoContext::Get()->GetFrameN();

View File

@ -52,6 +52,7 @@
#include "subs_grid.h"
#include "validators.h"
#include "video_context.h"
#include "utils.h"
///////////////
@ -59,6 +60,9 @@
DialogKanjiTimer::DialogKanjiTimer(wxWindow *parent, SubtitlesGrid *_grid)
: wxDialog (parent,-1,_("Kanji timing"),wxDefaultPosition)
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(kanji_timer_button)));
// Variables
AssFile *subs = AssFile::top;
grid = _grid;

View File

@ -62,6 +62,7 @@
#include "video_context.h"
#include "browse_button.h"
#include "tooltip_manager.h"
#include "utils.h"
///////
@ -77,6 +78,9 @@ enum {
DialogOptions::DialogOptions(wxWindow *parent)
: wxDialog(parent, -1, _T("Options"), wxDefaultPosition, wxDefaultSize)
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(options_button)));
// Create book
book = new wxTreebook(this,-1,wxDefaultPosition,wxSize(400,300));
needsRestart = false;

View File

@ -42,6 +42,7 @@
#include "video_display.h"
#include "validators.h"
#include "video_provider.h"
#include "utils.h"
///////////////
@ -49,6 +50,9 @@
DialogProperties::DialogProperties (wxWindow *parent)
: wxDialog(parent, -1, _("Script Properties"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(properties_toolbutton)));
// Setup
AssFile *subs = AssFile::top;

View File

@ -44,6 +44,7 @@
#include "subs_grid.h"
#include "validators.h"
#include "video_context.h"
#include "utils.h"
///////////////
@ -51,6 +52,9 @@
DialogResample::DialogResample(wxWindow *parent, SubtitlesGrid *_grid)
: wxDialog (parent,-1,_("Resample resolution"),wxDefaultPosition)
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(resample_toolbutton)));
// Variables
AssFile *subs = AssFile::top;
grid = _grid;

View File

@ -51,6 +51,7 @@
#include "ass_time.h"
#include "ass_dialogue.h"
#include "subs_edit_box.h"
#include "utils.h"
///////////////
@ -58,6 +59,9 @@
DialogShiftTimes::DialogShiftTimes (wxWindow *parent,SubtitlesGrid *_grid)
: wxDialog(parent, -1, _("Shift Times"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("JumpTo"))
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(shift_times_toolbutton)));
// Set initial values
ready = true;
grid = _grid;

View File

@ -65,6 +65,9 @@ enum {
DialogSpellChecker::DialogSpellChecker(wxFrame *parent)
: wxDialog(parent, -1, _("Spell Checker"), wxDefaultPosition, wxDefaultSize)
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(spellcheck_toolbutton)));
// Get spell checker
spellchecker = SpellCheckerFactory::GetSpellChecker();
if (!spellchecker) {

View File

@ -94,6 +94,9 @@ enum {
DialogStyleEditor::DialogStyleEditor (wxWindow *parent, AssStyle *_style, SubtitlesGrid *_grid)
: wxDialog (parent,-1,_("Style Editor"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER,_T("DialogStyleEditor"))
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(style_toolbutton)));
wxStopWatch performance_timer;
// Set styles
grid = _grid;

View File

@ -47,6 +47,7 @@
#include "standard_paths.h"
#include "options.h"
#include "subs_grid.h"
#include "utils.h"
///////////////
@ -55,9 +56,7 @@ DialogStyleManager::DialogStyleManager (wxWindow *parent,SubtitlesGrid *_grid)
: wxDialog (parent,-1,_("Styles Manager"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE,_T("DialogStylesManager"))
{
// Set icon
wxIcon ico;
ico.CopyFromBitmap(wxBITMAP(style_toolbutton));
SetIcon(ico);
SetIcon(BitmapToIcon(wxBITMAP(style_toolbutton)));
// Vars
grid = _grid;

View File

@ -48,6 +48,7 @@
#include "audio_display.h"
#include "audio_box.h"
#include "hotkeys.h"
#include "utils.h"
///////////////
@ -55,6 +56,9 @@
DialogStyling::DialogStyling (wxWindow *parent,SubtitlesGrid *_grid) :
wxDialog (parent, -1, _("Styling assistant"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxRESIZE_BORDER)
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(styling_toolbutton)));
// Variables
grid = _grid;
audio = VideoContext::Get()->audio->box->audioDisplay;

View File

@ -53,6 +53,9 @@
DialogTimingProcessor::DialogTimingProcessor(wxWindow *parent,SubtitlesGrid *_grid)
: wxDialog(parent,-1,_("Timing Post-Processor"),wxDefaultPosition,wxSize(400,250),wxDEFAULT_DIALOG_STYLE)
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(timing_processor_toolbutton)));
// Set variables
grid = _grid;
leadInTime = Options.AsText(_T("Audio lead in"));

View File

@ -48,6 +48,7 @@
#include "audio_display.h"
#include "frame_main.h"
#include "hotkeys.h"
#include "utils.h"
///////////////
@ -55,6 +56,9 @@
DialogTranslation::DialogTranslation (wxWindow *parent,AssFile *_subs,SubtitlesGrid *_grid,int startrow,bool preview)
: wxDialog(parent, -1, _("Translation Assistant"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX, _T("TranslationAssistant"))
{
// Set icon
SetIcon(BitmapToIcon(wxBITMAP(translation_toolbutton)));
// Set variables
enablePreview = preview;
main = parent;

View File

@ -347,3 +347,28 @@ int StringToFix(const wxString &str,size_t decimalPlaces,size_t start,size_t end
for (size_t i=0;i<decimalPlaces;i++) major *= 10;
return (major + minor)*sign;
}
////////////////////////////////
// Convert a wxBitmap to wxIcon
// This is needed because wxIcon has to be 16x16 to work properly on win32
wxIcon BitmapToIcon(wxBitmap iconBmp) {
// Create the icon and background bmp
wxIcon ico;
wxBitmap bmp(16,16);
// Blit bitmap into 16x16 one (don't remove brackets)
{
wxMemoryDC dc;
dc.SelectObject(bmp);
dc.SetBackground(wxColour(192,192,192));
dc.Clear();
dc.DrawBitmap(iconBmp,0,0,false);
}
// Create mask and convert to icon
wxMask *mask = new wxMask(bmp,wxColour(192,192,192));
bmp.SetMask(mask);
ico.CopyFromBitmap(bmp);
return ico;
}

View File

@ -68,6 +68,7 @@ int SmallestPowerOf2(int x);
void GetWordBoundaries(const wxString text,IntPairVector &results,int start=0,int end=-1);
int StringToInt(const wxString &str,size_t start=0,size_t end=-1);
int StringToFix(const wxString &str,size_t decimalPlaces,size_t start=0,size_t end=-1);
wxIcon BitmapToIcon(wxBitmap bmp);
//////////