Changeset 45 for oup/current/Main.pas
- Timestamp:
- Dec 23, 2006, 1:03:50 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/Main.pas
r43 r45 7 7 Dialogs, StdCtrls, StrUtils, Clipbrd, ExtCtrls, ComCtrls, Menus, Grids, 8 8 MPHexEditor, ToolWin, ImgList, Tabs, 9 Code_Functions, Data, Code_DataStructures,10 Helper_LevelDB, Code_Exporters, Settings,11 Tool_Preview, Tool_TxmpReplace, Tool_BinEdit, Tool_Extractor, Tool_RawEdit,12 Code_OniDataClass, MDITab, TB2Item, TB2Dock, TB2Toolbar, TB2MDI;9 MDITab, TB2Item, TB2Dock, TB2Toolbar, TB2MDI, 10 Code_Functions, Data, Code_DataStructures, Code_OniDataClass, 11 Helper_LevelDB, Code_Exporters, Settings, Tool_Template, 12 Tool_BinEdit, Tool_Extractor, Tool_Preview, Tool_RawEdit, Tool_TxmpReplace; 13 13 14 14 type … … 77 77 procedure menu_windows_nextClick(Sender: TObject); 78 78 procedure menu_windows_tileClick(Sender: TObject); 79 function open_child(window_context: String ): Boolean;79 function open_child(window_context: String; fileid: Integer): Boolean; 80 80 procedure menu_windows_closeallClick(Sender: TObject); 81 81 procedure menu_windows_cascadeClick(Sender: TObject); … … 305 305 ext := ExtractFileExt(opend.FileName); 306 306 if ext = '.dat' then 307 begin 307 308 if not CreateDataConnection(opend.FileName, ODB_Dat) then 308 309 ShowMessage('Error while loading the file:' + CrLf + opend.FileName + 309 CrLf + 'Perhaps not an Oni-.dat-file?') 310 else if ext = '.oldb' then 310 CrLf + 'Perhaps not an Oni-.dat-file?'); 311 end else if ext = '.oldb' then 312 begin 311 313 if not CreateDataConnection(opend.FileName, ODB_ADB) then 312 314 ShowMessage('Error while loading the file:' + CrLf + opend.FileName + 313 CrLf + 'Perhaps not an OniUnPacker-LevelDatabase-file?') 314 e lse315 CrLf + 'Perhaps not an OniUnPacker-LevelDatabase-file?'); 316 end else 315 317 ShowMessage('Incompatible file'); 316 318 AppSettings.DatPath := ExtractFilepath(opend.FileName); … … 394 396 procedure TForm_Main.menu_previewClick(Sender: TObject); 395 397 begin 396 open_child('preview' );398 open_child('preview', -1); 397 399 end; 398 400 … … 400 402 procedure TForm_Main.menu_txmpreplaceClick(Sender: TObject); 401 403 begin 402 open_child('txmpreplace' );404 open_child('txmpreplace', -1); 403 405 end; 404 406 … … 406 408 procedure TForm_Main.menu_bineditClick(Sender: TObject); 407 409 begin 408 open_child('binedit' );410 open_child('binedit', -1); 409 411 end; 410 412 … … 412 414 procedure TForm_Main.menu_raweditClick(Sender: TObject); 413 415 begin 414 open_child('rawedit' );416 open_child('rawedit', -1); 415 417 end; 416 418 … … 418 420 procedure TForm_Main.menu_extractorClick(Sender: TObject); 419 421 begin 420 open_child('extractor' );422 open_child('extractor', -1); 421 423 end; 422 424 … … 424 426 procedure TForm_Main.menu_filecompareClick(Sender: TObject); 425 427 begin 426 open_child('compare' );428 open_child('compare', -1); 427 429 end; 428 430 … … 515 517 516 518 517 function TForm_Main.open_child(window_context: String ): Boolean;519 function TForm_Main.open_child(window_context: String; fileid: Integer): Boolean; 518 520 var 519 form: TCustomForm;521 toolform: TForm_ToolTemplate; 520 522 i: Integer; 521 523 tag: Integer; … … 534 536 if window_context = 'binedit' then 535 537 begin 536 form := TForm_BinEdit.Create(Application); 537 TForm_BinEdit(form).Recreatelist; 538 form.Caption := 'Binary .dat-Editor ' + IntToStr(tag); 539 iconindex := 0; 538 toolform := TForm_BinEdit.Create(Self); 539 toolform.Caption := 'Binary .dat-Editor ' + IntToStr(tag); 540 iconindex := 0; 541 end; 542 if window_context = 'extractor' then 543 begin 544 toolform := TForm_Extractor.Create(Self); 545 toolform.Caption := 'Extractor ' + IntToStr(tag); 546 end; 547 if window_context = 'preview' then 548 begin 549 toolform := TForm_Preview.Create(Self); 550 toolform.Caption := 'Preview-Window ' + IntToStr(tag); 540 551 end; 541 552 if window_context = 'rawedit' then 542 553 begin 543 form := TForm_RawEdit.Create(Application); 544 TForm_RawEdit(form).Recreatelist; 545 form.Caption := 'Binary .raw-Editor ' + IntToStr(tag); 546 end; 547 if window_context = 'preview' then 548 begin 549 form := TForm_Preview.Create(Application); 550 TForm_Preview(form).Recreatelist; 551 form.Caption := 'Preview-Window ' + IntToStr(tag); 554 toolform := TForm_RawEdit.Create(Self); 555 toolform.Caption := 'Binary .raw-Editor ' + IntToStr(tag); 552 556 end; 553 557 if window_context = 'txmpreplace' then 554 558 begin 555 form := TForm_TxmpReplace.Create(Application); 556 TForm_TxmpReplace(form).Recreatelist; 557 form.Caption := 'TXMP Replacer ' + IntToStr(tag); 558 end; 559 if window_context = 'extractor' then 560 begin 561 form := TForm_Extractor.Create(Application); 562 TForm_Extractor(form).Recreatelist; 563 form.Caption := 'Extractor ' + IntToStr(tag); 564 end; 565 566 form.Name := window_context + IntToStr(tag); 567 form.Tag := tag; 568 569 MDITab.AddTab(TForm(form), iconindex); 559 toolform := TForm_TxmpReplace.Create(Application); 560 toolform.Caption := 'TXMP Replacer ' + IntToStr(tag); 561 end; 562 563 if Assigned(toolform) then 564 begin 565 toolform.Name := window_context + IntToStr(tag); 566 toolform.Tag := tag; 567 MDITab.AddTab(TForm(toolform), iconindex); 568 if fileid > -1 then 569 toolform.SelectFileID(fileid); 570 end; 570 571 end; 571 572
Note: See TracChangeset
for help on using the changeset viewer.