Ignore:
Timestamp:
Nov 30, 2017, 5:19:57 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: Correctly set filename in open/save dialog.
  • Modified: Improved generation of compiler code.
Location:
branches/generator/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/generator/Forms/UFormMain.lfm

    r126 r127  
    55  Width = 1050
    66  Caption = 'Language generator'
    7   ClientHeight = 644
     7  ClientHeight = 653
    88  ClientWidth = 1050
    99  Menu = MainMenu1
     
    1111  OnCloseQuery = FormCloseQuery
    1212  OnShow = FormShow
    13   LCLVersion = '1.8.0.4'
     13  LCLVersion = '1.6.4.0'
    1414  object MemoBNF: TMemo
    1515    Left = 0
    16     Height = 609
     16    Height = 618
    1717    Top = 35
    1818    Width = 1050
     
    3939      Height = 22
    4040      Top = 5
    41       Width = 47
     41      Width = 124
    4242      Align = alNone
    4343      AutoSize = True
    4444      BorderSpacing.Left = 22
    4545      BorderSpacing.Top = 3
    46       Caption = 'ToolBar1'
    4746      EdgeInner = esNone
    4847      EdgeOuter = esNone
     
    5352      Transparent = True
    5453      object ToolButton1: TToolButton
    55         Left = 1
     54        Left = 78
    5655        Top = 0
    5756        Action = ARules
    5857      end
    5958      object ToolButton2: TToolButton
     59        Left = 101
     60        Top = 0
     61        Action = ABuildCompiler
     62      end
     63      object ToolButton3: TToolButton
     64        Left = 1
     65        Top = 0
     66        Action = AProjectNew
     67      end
     68      object ToolButton4: TToolButton
    6069        Left = 24
    6170        Top = 0
    62         Action = ABuildCompiler
     71        Action = AProjectOpen
     72      end
     73      object ToolButton5: TToolButton
     74        Left = 47
     75        Top = 0
     76        Action = AProjectSave
     77      end
     78      object ToolButton6: TToolButton
     79        Left = 70
     80        Height = 22
     81        Top = 0
     82        Width = 8
     83        Caption = 'ToolButton6'
     84        Style = tbsSeparator
    6385      end
    6486    end
     
    6688  object MainMenu1: TMainMenu
    6789    Images = Core.ImageList1
    68     left = 312
     90    left = 304
    6991    top = 229
    7092    object MenuItem2: TMenuItem
     
    161183  end
    162184  object OpenDialog1: TOpenDialog
     185    DefaultExt = '.grm'
     186    Filter = 'Grammer (.grm)|*.grm|All files|*.*'
    163187    left = 748
    164188    top = 188
    165189  end
    166190  object SaveDialog1: TSaveDialog
     191    DefaultExt = '.grm'
     192    Filter = 'Grammer (.grm)|*.grm|All files|*.*'
    167193    left = 587
    168194    top = 414
  • branches/generator/Forms/UFormMain.pas

    r126 r127  
    4545    ToolButton1: TToolButton;
    4646    ToolButton2: TToolButton;
     47    ToolButton3: TToolButton;
     48    ToolButton4: TToolButton;
     49    ToolButton5: TToolButton;
     50    ToolButton6: TToolButton;
    4751    procedure ABuildCompilerExecute(Sender: TObject);
    4852    procedure AExitExecute(Sender: TObject);
     
    7882  SUnsavedChanges = 'Unsaved changes';
    7983  SDoYouWantToSaveProject = 'There are unsaved changes in project. Do you want to save them?';
    80   SNewGrammer = 'New grammer.xtg';
     84  SNewGrammer = 'New grammer.grm';
    8185
    8286  { TFormMain }
     
    96100procedure TFormMain.AProjectSaveAsExecute(Sender: TObject);
    97101begin
    98   SaveDialog1.FileName := Core.Grammer.FileName;
     102  SaveDialog1.InitialDir := ExtractFileDir(Core.Grammer.FileName);
     103  SaveDialog1.FileName := ExtractFileName(Core.Grammer.FileName);
    99104  if SaveDialog1.Execute then begin
    100105    Core.LastOpenedFile := SaveDialog1.FileName;
     
    192197  AProjectClose.Execute;
    193198  if not Assigned(Core.Grammer) then begin
    194     OpenDialog1.FileName := Core.LastOpenedFile;
     199    OpenDialog1.InitialDir := ExtractFileDir(Core.LastOpenedFile);
     200    OpenDialog1.FileName := ExtractFileName(Core.LastOpenedFile);
    195201    if OpenDialog1.Execute then begin
    196202      Core.LastOpenedFile := OpenDialog1.FileName;
Note: See TracChangeset for help on using the changeset viewer.