ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/releases/0.33a/Main.pas
(Generate patch)

Comparing:
oup/current/Main.pas (file contents), Revision 46 by alloc, Sat Dec 23 16:26:43 2006 UTC vs.
oup/releases/0.33a/Main.pas (file contents), Revision 76 by alloc, Thu Jan 11 23:38:49 2007 UTC

# Line 66 | Line 66 | type
66      tb_rawedit: TTBItem;
67      tb_datedit: TTBItem;
68      menu_windows_tilevert: TTBItem;
69 +    tb_meta: TTBItem;
70 +    menu_meta: TTBItem;
71 +    TBSeparatorItem1: TTBSeparatorItem;
72 +    tb_db2dat: TTBItem;
73 +    tb_dat2db: TTBItem;
74 +    menu_loaddb: TTBItem;
75 +    tb_opendb: TTBItem;
76 +    procedure LoadFile(typedb: Boolean);
77      function TryCloseAll: Boolean;
78      procedure menu_AboutClick(Sender: TObject);
79      procedure menu_settingsClick(Sender: TObject);
# Line 98 | Line 106 | type
106      procedure MDITabMouseUp(Sender: TObject; Button: TMouseButton;
107        Shift: TShiftState; X, Y: Integer);
108      procedure menu_windows_tilevertClick(Sender: TObject);
109 +    procedure menu_metaClick(Sender: TObject);
110 +    procedure ToolbarDockChanged(Sender: TObject);
111 +    procedure menu_loaddbClick(Sender: TObject);
112    private
113    public
114    end;
# Line 279 | Line 290 | end;
290  
291  
292  
293 + procedure TForm_Main.ToolbarDockChanged(Sender: TObject);
294 + var
295 +  toolbar: TTBToolbar;
296 +  position: TTBDockPosition;
297 +  mode: TTBItemDisplayMode;
298 +  i: Integer;
299 +  isEnabled: Boolean;
300 + begin
301 +  toolbar := TTBToolbar(Sender);
302 +  if toolbar.Floating then
303 +    mode := nbdmImageAndText
304 +  else begin
305 +    position := toolbar.CurrentDock.Position;
306 +    if position in [dpLeft, dpRight] then
307 +      mode := nbdmDefault
308 +    else
309 +      mode := nbdmImageAndText;
310 +  end;
311 +  for i := 0 to toolbar.Items.Count - 1 do
312 +    toolbar.Items.Items[i].DisplayMode := mode;
313 + end;
314 +
315   function TForm_Main.TryCloseAll: Boolean;
316   begin
317    menu_windows_closeallClick(Self);
# Line 290 | Line 323 | begin
323   end;
324  
325  
326 < {#################################}
327 < {##### Main-Menu-Handlers    #####}
295 < {#################################}
296 < procedure TForm_Main.menu_loadfileClick(Sender: TObject);
326 >
327 > procedure TForm_Main.LoadFile(typedb: Boolean);
328   var
329    ext: String;
330   begin
# Line 302 | Line 333 | begin
333      CloseDataConnection;
334      opend.InitialDir := AppSettings.DatPath;
335      opend.Filter     := 'Compatible level files|*.dat;*.oldb|Oni level (*.dat)|*.dat|OUP level database (*.oldb)|*.oldb|Any (*.*)|*';
336 +    if typedb then
337 +      opend.FilterIndex := 3
338 +    else
339 +      opend.FilterIndex := 2;
340      if opend.Execute then
341      begin
342        ext := ExtractFileExt(opend.FileName);
# Line 324 | Line 359 | begin
359   end;
360  
361  
362 + {#################################}
363 + {##### Main-Menu-Handlers    #####}
364 + {#################################}
365 + procedure TForm_Main.menu_loaddbClick(Sender: TObject);
366 + begin
367 +  LoadFile(True);
368 + end;
369 +
370 + procedure TForm_Main.menu_loadfileClick(Sender: TObject);
371 + begin
372 +  LoadFile(False);
373 + end;
374 +
375 +
376  
377  
378   procedure TForm_Main.menu_settingsClick(Sender: TObject);
# Line 425 | Line 474 | begin
474   end;
475  
476  
477 + procedure TForm_Main.menu_metaClick(Sender: TObject);
478 + begin
479 +  ShowMessage('TBD');
480 + end;
481 +
482 +
483   procedure TForm_Main.menu_filecompareClick(Sender: TObject);
484   begin
485    open_child('compare', -1);
# Line 544 | Line 599 | begin
599    begin
600      toolform         := TForm_BinEdit.Create(Self);
601      toolform.Caption := 'Binary .dat-Editor ' + IntToStr(tag);
602 <    iconindex        := 4;
602 >    iconindex        := 5;
603    end;
604    if window_context = 'extractor' then
605    begin
606      toolform         := TForm_Extractor.Create(Self);
607      toolform.Caption := 'Extractor ' + IntToStr(tag);
608 <    iconindex        := 7;
608 >    iconindex        := 8;
609    end;
610    if window_context = 'preview' then
611    begin
612      toolform         := TForm_Preview.Create(Self);
613      toolform.Caption := 'Preview-Window ' + IntToStr(tag);
614 <    iconindex        := 3;
614 >    iconindex        := 4;
615    end;
616    if window_context = 'rawedit' then
617    begin
618      toolform         := TForm_RawEdit.Create(Self);
619      toolform.Caption := 'Binary .raw-Editor ' + IntToStr(tag);
620 <    iconindex        := 5;
620 >    iconindex        := 6;
621    end;
622    if window_context = 'txmpreplace' then
623    begin
624      toolform         := TForm_TxmpReplace.Create(Application);
625      toolform.Caption := 'TXMP Replacer ' + IntToStr(tag);
626 <    iconindex        := 6;
626 >    iconindex        := 7;
627    end;
628  
629    if Assigned(toolform) then

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)