Results 1 to 16 of 16

Thread: SCAR Notepad

  1. #1
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default SCAR Notepad

    This is a little project i'm going to work on for a few days/weeks.

    What it has so far

    Resizable
    Color/Size/Font changing
    Open/Save

    What i'm planning to add

    SCAR Syntax highlighting
    Underline compiling errors.

    So just download and press play. Post suggustions.

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Uggh, the standards, they burn
    Other than that, it's a pretty cool Scar notepad, though I've made a Delphi version so I was disappointed to not find a few of the more useful options. Also, I don't think you can change the font for only selected text unless you made it dynamically create memo's yo store the text and then changed only that, though I think that could mess up the view. Maybe try and find a Delphi way of doing it and seeing if that works with Scar - that's what I always do.
    Edit: I just realised this, but why would you want to code in a notepad inside scar when you could just code in scar? It's a mini-paradox I say!
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  3. #3
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea my standards suck. Can you give me some suggustions pl0x. And you changed your name

  4. #4
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    Maybe if you get the SCAR syntaxing figured out, make it optional..
    STOP PM'ING ME

  5. #5
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    If you want to change the style of the selected text only, use a TRichEdit. You can change the selection with SelAttributes.
    Hup Holland Hup!

  6. #6
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ty nielse credits for you

    edit: but i can't get a scrollbar to go on a trichedit what do i use on that.

  7. #7
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    as far as i know, you cant do the font thing(ive tried). and my syntax highlighter, doesnt work yet so, i cant help you with that either .

    i dont want to give you too many suggestions, because if you look in my sig...

    EDIT: as for scrollbar on trichedit - i requested freddy to add it into 3.15 and it is, you need
    SCAR Code:
    hidescrollbars := false;
        scrollbars := ssvertical;

    and it doesnt matter, the fonts attribute for trichedit, isnt for the words its for the whole thing
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  8. #8
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    SCAR Code:
    program New;
    var
      MainForm: TForm;

    procedure InitForm;
    begin
      MainForm := CreateForm;
      MainForm.Width := 400;
      MainForm.Height := 400;
      MainForm.Caption := 'MainForm';
      MainForm.Color := clBtnFace;
      MainForm.BorderIcons := [biSystemMenu];
      MainForm.BorderStyle := bsSingle;
      MainForm.Font.Color := clWindowText;
      MainForm.Font.Height := -11;
      MainForm.Font.Name := 'MS Sans Serif';
      MainForm.Font.Style := [];
      MainForm.PixelsPerInch := 96;
     
      with TRichEdit.Create(MainForm) do
      begin
        Parent := MainForm;
        Align := alClient;
        ScrollBars := ssBoth;
        HideScrollBars := False;
        Text := 'hello there '+Chr(13)+'123'+chr(13)+'456';
        SelStart := 0;
        SelLength := Length('hello there ');
        SelAttributes.Color := clTeal;
        SelStart := Length('hello there ') + 1;
        SelLength := Length('123');
        SelAttributes.Style := SelAttributes.Style + [fsBold];
        SelLength := 0;
      end;
    end;

    procedure ShowFormModal;
    begin
      MainForm.ShowModal;
    end;

    var
      v: TVariantArray;
    begin
      v := [];
      ThreadSafeCall('InitForm', v);
      ThreadSafeCall('ShowFormModal', v);
      FreeForm(MainForm);
    end.
    Hup Holland Hup!

  9. #9
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nielse i tried doing what you said but this dosent work when i change what the font is

    SCAR Code:
    RichEdit1.SelAttributes.Name := FontDialog1.Font.Name;

    what chagnes the type of font? etc arial, times new roman

  10. #10
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    trichedit.font.Name is what changes the font. but like i said, all it does is change the font for the whole thing.

    I bet you could install a component in delphi and plugin-it in to scar though(i just dont know how to ).
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  11. #11
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    SCAR Code:
    program New;
    var
      MainForm: TForm;

    procedure InitForm;
    var
      f: TFont;
    begin
      MainForm := CreateForm;
      MainForm.Width := 400;
      MainForm.Height := 400;
      MainForm.Caption := 'MainForm';
      MainForm.Color := clBtnFace;
      MainForm.BorderIcons := [biSystemMenu];
      MainForm.BorderStyle := bsSingle;
      MainForm.Font.Color := clWindowText;
      MainForm.Font.Height := -11;
      MainForm.Font.Name := 'MS Sans Serif';
      MainForm.Font.Style := [];
      MainForm.PixelsPerInch := 96;

      with TRichEdit.Create(MainForm) do
      begin
        Parent := MainForm;
        Align := alClient;
        ScrollBars := ssBoth;
        HideScrollBars := False;
        Text := 'hello there '+Chr(13)+'123'+chr(13)+'456';
        SelStart := 0;
        SelLength := Length('hello there ');
        SelAttributes.Color := clTeal; //Change color
        SelStart := SelStart + SelLength + 1;
        SelLength := Length('123');
        SelAttributes.Style := SelAttributes.Style + [fsBold]; //Set bold
        SelStart := SelStart + SelLength + 1;
        SelLength := Length('456');
        f := TFont.Create;
        f.Name := 'courier new'; //Change font
        SelAttributes.Assign(f);
        f.Free;
        SelLength := 0;
      end;
    end;

    procedure ShowFormModal;
    begin
      MainForm.ShowModal;
    end;

    var
      v: TVariantArray;
    begin
      v := [];
      ThreadSafeCall('InitForm', v);
      ThreadSafeCall('ShowFormModal', v);
      FreeForm(MainForm);
    end.

    Because SCAR doesn't have the name property in SelAttributes you have to do it this way.

    If you use a TFontDialog, you don't need the extra variable:

    SCAR Code:
    program New;
    var
      MainForm: TForm;

    procedure InitForm;
    begin
      MainForm := CreateForm;
      MainForm.Width := 400;
      MainForm.Height := 400;
      MainForm.Caption := 'MainForm';
      MainForm.Color := clBtnFace;
      MainForm.BorderIcons := [biSystemMenu];
      MainForm.BorderStyle := bsSingle;
      MainForm.Font.Color := clWindowText;
      MainForm.Font.Height := -11;
      MainForm.Font.Name := 'MS Sans Serif';
      MainForm.Font.Style := [];
      MainForm.PixelsPerInch := 96;

      with TRichEdit.Create(MainForm) do
      begin
        Parent := MainForm;
        Align := alClient;
        ScrollBars := ssBoth;
        HideScrollBars := False;
        Text := 'hello there '+Chr(13)+'123'+chr(13)+'456';
        SelStart := 0;
        SelLength := Length('hello there ');
        SelAttributes.Color := clTeal;
        SelStart := SelStart + SelLength + 1;
        SelLength := Length('123');
        SelAttributes.Style := SelAttributes.Style + [fsBold];
        SelStart := SelStart + SelLength + 1;
        SelLength := Length('456');
        with TFontDialog.Create(MainForm) do
        begin
          if Execute then
            SelAttributes.Assign(Font);
          Free;
        end;
        SelLength := 0;
      end;
    end;

    procedure ShowFormModal;
    begin
      MainForm.ShowModal;
    end;

    var
      v: TVariantArray;
    begin
      v := [];
      ThreadSafeCall('InitForm', v);
      ThreadSafeCall('ShowFormModal', v);
      FreeForm(MainForm);
    end.

    Notice how you can set pretty much everything at once with the assign procedure in combination with a TFont?
    Hup Holland Hup!

  12. #12
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Why would you use a scar notepad?
    ~Hermen

  13. #13
    Join Date
    Jun 2007
    Posts
    785
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    because it owns? and you could always add your own cool stuff to it aye?

    [22:20] <[-jesus-]> freddy, go uninstall yourself

  14. #14
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ehh, can anyone post any suggustions i can make anything you need....? and this isn't current version still working on my alpha version (not beta) i won't release until beta so you guys test. but dan is already working on and it's pretty cool so far

  15. #15
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Did it work out with the font style for the selected text?
    Hup Holland Hup!

  16. #16
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yep it did nielse thanks i added a lot more stuff but its not released yet . the uploaded one is teh shizzy 1

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. notepad
    By DaNkaTa` in forum OSR Help
    Replies: 4
    Last Post: 03-05-2008, 05:52 PM
  2. Replies: 12
    Last Post: 08-27-2007, 10:03 AM
  3. Replies: 28
    Last Post: 06-22-2006, 04:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •