Develop and Download Open Source Software

Browse Subversion Repository

Contents of /CopalPro/NewLang.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download) (as text)
Thu Jul 28 09:05:52 2011 UTC (12 years, 9 months ago) by kaityo
File MIME type: text/x-c++src
File size: 2208 byte(s)
First Commit
1 //---------------------------------------------------------------------------
2 #include <vcl.h>
3 #pragma hdrstop
4
5 #include "KCopalConfig.h"
6 #include "NewLang.h"
7 //---------------------------------------------------------------------------
8 #pragma package(smart_init)
9 #pragma resource "*.dfm"
10 TFNewLang *FNewLang;
11 //---------------------------------------------------------------------------
12 __fastcall
13 TFNewLang::TFNewLang(TComponent* Owner) : TForm(Owner) {
14 CopalConfig = NULL;
15 }
16 //---------------------------------------------------------------------------
17 /**
18 * 実行する
19 * 返り値:bool
20 * true 変化あり
21 * false キャンセル
22 */
23 bool
24 TFNewLang::Execute(KCopalConfig *_CopalConfig) {
25
26 EdLangName->Text = "";
27 EdLangPath->Text = "";
28 CopalConfig = _CopalConfig;
29 int mr = ShowModal();
30 if(mr==mrOk) {
31 LangName = EdLangName->Text.Trim();
32 LangPath = EdLangPath->Text;
33 return true;
34 } else {
35 return false;
36 }
37 }
38 //---------------------------------------------------------------------------
39 /**
40 * チェック
41 */
42 void __fastcall
43 TFNewLang::BtOKClick(TObject *Sender) {
44 if(EdLangName->Text.Trim()=="") {
45 ShowMessage("言語名を指定してください");
46 ModalResult = mrNone;
47 return;
48 }
49 if(EdLangPath->Text=="") {
50 ShowMessage("実行パスを指定してください");
51 ModalResult = mrNone;
52 return;
53 }
54 if(!FileExists(EdLangPath->Text)) {
55 ShowMessage("ファイル " + EdLangPath->Text +"は存在しません");
56 ModalResult = mrNone;
57 return;
58 }
59 if(CopalConfig->LanguageExists(EdLangName->Text)){
60 ShowMessage("既に同じ名前の設定ファイルが存在します");
61 ModalResult = mrNone;
62 return;
63 }
64
65 }
66 //---------------------------------------------------------------------------
67 /**
68 * 参照ボタン
69 */
70 void __fastcall
71 TFNewLang::BtBrowseClick(TObject *Sender) {
72 if(!OpenDialog->Execute()) {
73 return;
74 }
75 EdLangPath->Text = OpenDialog->FileName;
76 }
77 //---------------------------------------------------------------------------
78 void __fastcall
79 TFNewLang::FormShow(TObject *Sender) {
80 EdLangName->SetFocus();
81 }
82 //---------------------------------------------------------------------------
83

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26