Check-in [d0c9d18859]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Adjusted some comments.
Timelines: family | ancestors | descendants | both | lazarus
Files: files | file ages | folders
SHA1:d0c9d1885945cff31890db00292ff9633ceb655e
User & Date: tinus 2014-08-11 19:40:41
Context
2014-08-13
08:24
Added SetBusy (manages the hourglass cursor), and call it when busy. On Windows, remove extra carriage returns from the diff command's output. check-in: 7b66514616 user: MCO tags: lazarus
2014-08-11
19:40
Adjusted some comments. check-in: d0c9d18859 user: tinus tags: lazarus
19:35
Added some colour to the CSS highlighter. check-in: 709319fa2c user: tinus tags: lazarus
Changes

Changes to src/a_fileversioninfo.pas.

220
221
222
223
224
225
226

227
228
229
230
231
232
233
...
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
  sContents: string;
  CharPos: Integer;
begin
  synEdit.Visible := Assigned(FFile);
  if not Assigned(FFile) then
    Exit;


  // TODO: figure out the first button down AND enabled; if it's not enabled,
  //  we should try the other ones that ARE enabled.

  synEdit.BeginUpdate(False);
  try
    synEdit.Lines.Clear;
    try
................................................................................
        synEdit.Gutter.Parts.ByClass[TSynGutterLineNumber, 0].Visible := True;

      end else if btnViewContents.Down then begin
        synEdit.Highlighter := DetermineFileHighlighter();
        Contents := FFile.GetContents;
        try
          if synEdit.Highlighter = nil then begin
            //TPicture.RegisterFileFormat('ico', 'Icon', TIcon);
            try
              imgContents.Picture.LoadFromStreamWithFileExt(Contents, ExtractFileExt(FFile.Filename));
              imgContents.Stretch := (imgContents.Picture.Graphic.Width > imgContents.Width)
                                    or (imgContents.Picture.Graphic.Height > imgContents.Height);
              imgContents.Visible := True;
              synEdit.Visible := False;
            except
              on E: Exception do begin
                imgContents.Visible := False;
                synEdit.Visible := True;
                MessageBoxFunction(PChar(E.Message), PChar(string(E.ClassName)), $30);
              end {Exception};
            end {except};
          end {if};

          if synEdit.Visible then begin
            with TStringStream.Create('') do begin
              CopyFrom(Contents, 0);







>







 







|










|







220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
...
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
  sContents: string;
  CharPos: Integer;
begin
  synEdit.Visible := Assigned(FFile);
  if not Assigned(FFile) then
    Exit;

  // TODO: instead of buttons, use a TTabControl with a tab for each view mode.
  // TODO: figure out the first button down AND enabled; if it's not enabled,
  //  we should try the other ones that ARE enabled.

  synEdit.BeginUpdate(False);
  try
    synEdit.Lines.Clear;
    try
................................................................................
        synEdit.Gutter.Parts.ByClass[TSynGutterLineNumber, 0].Visible := True;

      end else if btnViewContents.Down then begin
        synEdit.Highlighter := DetermineFileHighlighter();
        Contents := FFile.GetContents;
        try
          if synEdit.Highlighter = nil then begin
            // The file type was not recognized; we'll try the picture formats now
            try
              imgContents.Picture.LoadFromStreamWithFileExt(Contents, ExtractFileExt(FFile.Filename));
              imgContents.Stretch := (imgContents.Picture.Graphic.Width > imgContents.Width)
                                    or (imgContents.Picture.Graphic.Height > imgContents.Height);
              imgContents.Visible := True;
              synEdit.Visible := False;
            except
              on E: Exception do begin
                imgContents.Visible := False;
                synEdit.Visible := True;
                //MessageBoxFunction(PChar(E.Message), PChar(string(E.ClassName)), $30);
              end {Exception};
            end {except};
          end {if};

          if synEdit.Visible then begin
            with TStringStream.Create('') do begin
              CopyFrom(Contents, 0);