Results 1 to 19 of 19

Thread: SRL Message Box

  1. #1
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default SRL Message Box

    There we go updated it now you cant say the other is better.
    Yes there's more stuff to fill out but its not hard questions=]

    updated again now it has multi line.

    SCAR Code:
    program New;
    var
      frmDesign : TForm;
      BitBtn1 : TBitBtn;
      labelwidth, txtsize, msgboxheight : Integer;
      txtup : string;
      txtbold, txtit,txtuline:boolean;
      Memo1 : TMemo;
      Msg:array of String;
      MsgPos:integer;
     
    procedure LoadMsgBoxForm;
    begin
    frmDesign := CreateForm;
    frmDesign.Left := 250;
    frmDesign.Top := 50;
    frmDesign.Width := labelwidth+16;
    frmDesign.Height := msgboxheight+78;
    frmDesign.Caption := txtup;
    frmDesign.Color := clBtnFace;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.Visible := False;
    frmDesign.PixelsPerInch := 96;
    Memo1 := TMemo.Create(frmDesign);
    Memo1.Color := clBtnFace;
    memo1.Parent := frmDesign;
    memo1.Font.size:= txtsize;
    memo1.ReadOnly:=true;
    For MsgPos:=0 to high(Msg) do
    memo1.Lines.add (msg[MsgPos]);
    If txtbold then
    memo1.Font.Style := [fsBold];
    If txtit then
    memo1.Font.Style := [fsItalic];
    If txtuline then
    memo1.Font.Style := [fsUnderline];
    memo1.Left := 0;
    memo1.Top := 0;
    memo1.Width := labelWidth;
    memo1.Height := msgboxheight;
    BitBtn1 := TBitBtn.Create(frmDesign);
    BitBtn1.Parent := frmDesign;
    BitBtn1.Left := (memo1.Width-137);
    BitBtn1.Top := memo1.Height;
    BitBtn1.Width := 137;
    BitBtn1.Height := 41;
    BitBtn1.Caption := 'Ok';
    BitBtn1.ModalResult := 1;
    BitBtn1.TabOrder := 8;
    end;

    procedure ShowMsgBoxFormModal;
    begin
      frmDesign.ShowModal;
    end;

    Procedure MsgBox(Message:array of string;Uptext:String;Size:integer;Bold,Underlined,Italic:boolean;width,height:integer;sound:Boolean);
    Var
      V: TVariantArray;
    begin
        setarraylength(Msg,High(message)+1)
        setarraylength(Message,High(message)+1)
        labelwidth:=width;
        msgboxheight:=height;
        for MsgPos:= 0 to high(message) do
        msg[MsgPos]:=message[MsgPos];
        txtup:=uptext;
        txtbold:=bold;
        txtuline:=underlined;
        txtit:=italic;
        txtsize:=size;
        V := [];
        ThreadSafeCall('LoadMsgBoxForm', V);
        V := [];
        If sound then
        PlaySound('C:\WINDOWS\Media\tada.wav');
        ThreadSafeCall('ShowMsgBoxFormModal', V);
    end;

    begin
      MsgBox(['hello','hi','bob','yay'],'MsgBox',15,True,True,True,200,100,True);
    end.
    Blank!

  2. #2
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Waddo View Post
    I wonder if this or some variation of this could be added into the next SRL.

    SCAR Code:
    program New;
    var
      frmDesign : TForm;
      Label1 : TLabel;
      BitBtn1 : TBitBtn;
      labelwidth, txtsize : Integer;
      Msg : string;

    procedure LoadMsgBoxForm;
    begin
    frmDesign := CreateForm;
    frmDesign.Left := 250;
    frmDesign.Top := 114;
    frmDesign.Width := labelwidth;
    frmDesign.Height := 154;
    frmDesign.Caption := 'MsgBox';
    frmDesign.Color := clBtnFace;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.Visible := False;
    frmDesign.PixelsPerInch := 96;
    Label1 := TLabel.Create(frmDesign);
    label1.Caption:=Msg;
    Label1.Parent := frmDesign;
    label1.Font.size:= 12;
    Label1.Left := 32;
    Label1.Top := 24;
    Label1.Width := labelWidth-48;
    Label1.Height := 81;
    BitBtn1 := TBitBtn.Create(frmDesign);
    BitBtn1.Parent := frmDesign;
    BitBtn1.Left := labelWidth-137-20;
    BitBtn1.Top := 68;
    BitBtn1.Width := 137;
    BitBtn1.Height := 41;
    BitBtn1.Caption := 'Ok';
    BitBtn1.ModalResult := 1;
    BitBtn1.TabOrder := 8;
    end;

    procedure ShowMsgBoxFormModal;
    begin
      frmDesign.ShowModal;
    end;

    Procedure MsgBox(Message:String;Size:integer;width:integer);
    Var
      V: TVariantArray;
    begin
        labelwidth:=width;
        msg:=message;
        txtsize:=size;
        V := [];
        ThreadSafeCall('LoadMsgBoxForm', V);
        V := [];
        ThreadSafeCall('ShowMsgBoxFormModal', V);
    end;

    begin
      MsgBox('hello',15,360);
    end.

    Run it to check how it works.
    You actually already can.. 2 ways: ShowMessage(msg : string); But that is pretty fucked up, ask freddy1990 to fix it.. Or you can do GetApplication.MessageBox('Ya','Ya',0);
    Verrekte Koekwous

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

    Default

    Meh... i think it's a good and useful idea.

    Good job Waddo.. if I made scripts I'd prolly use it
    STOP PM'ING ME

  4. #4
    Join Date
    Oct 2007
    Location
    If (Online) then Loc := ('On comp') else Loc := ('Somewhere else!');
    Posts
    2,020
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;


    begin
      GetApplication.MessageBox('thank you for using','ya',0);
      wait(1500);
      begin
        GetApplication.MessageBox('plz use again soon','ya',0);
      end;
    end.

    yer that way works quite good actualy

    showmeesage is meesed up wont even deplay it

  5. #5
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Or here is something MasterKill based, edited and 'l33t3d up by moi':

    SCAR Code:
    procedure StartClick(sender: TObject);
    begin
      frmDesign.ModalResult:= mrOk;
      OkayClick := True;
    end;

    procedure InitForm;
    var
      Label1,Label2: TLabel;
      StartButton: TButton;
    begin
      frmDesign := CreateForm;
      frmDesign.Left := 300;
      frmDesign.Top := 300;
      frmDesign.Width := 500;
      frmDesign.Height := 100;
      frmDesign.Caption := upzor;
      frmDesign.Color := clBlack;
      frmDesign.Font.Color := clWindowText;
      frmDesign.Font.Height := -11;
      frmDesign.Font.Name := upzor;
      frmDesign.Font.Style := [];
      frmDesign.Visible := False;
      frmDesign.PixelsPerInch := 96;

      Label2 := TLabel.Create(frmDesign);
      Label2.Font.Color := clNeonPink;
      Label2.Parent := frmDesign;
      Label2.Left := 5;
      Label2.Top := 5;
      Label2.Width := 46;
      Label2.Height := 13;
      Label2.Font.Size := 10;
      Label2.Caption := onezor;

      Label1 := TLabel.Create(frmDesign);
      Label1.Font.Color := clNeonPink;
      Label1.Parent := frmDesign;
      Label1.Left := 5;
      Label1.Top := 25;
      Label1.Width := 46;
      Label1.Height := 13;
      Label1.Font.Size := 10;
      Label1.Caption := twozor;

      StartButton := TButton.Create(frmDesign);
      StartButton.Parent := frmDesign;
      StartButton.OnClick := @StartClick;
      StartButton.Left := 5;
      StartButton.Top := 45;
      StartButton.Width := 480;
      StartButton.Height := 21;
      StartButton.Caption := 'Click here to Continue  (The OK Button)';
      StartButton.TabOrder := 10;
    end;

    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      SetArrayLength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      SetArrayLength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;

    procedure ErrorForm(Uptextt, msgone, msgtwo: String; Terminate: Boolean);
    begin
      Upzor := uptextt;
      Onezor := msgone;
      Twozor := msgtwo;
      OkayClick := False;
      PlaySound('C:\WINDOWS\Media\tada.wav'); // Hope I don't scare you... hehehe...
      if not UseForm then
      begin
        WriteLn('@@@ '+Msgone+'.');
        Writeln('@@@ '+Msgtwo+'.');
        WriteLn(' ~~~~~~~~~~~~~ ');
        if Terminate then
          TerminateScript
        else
        begin
          Wait(5000);
          Exit;
        end;
      end;
      repeat
        SafeInitForm;
        SafeShowFormModal;
        if OkayClick then
          Break;
        PlaySound('C:\WINDOWS\Media\tada.wav');
        WriteLn('Please press ''OK''!');
        Wait(1+Random(250));
      until(OkayClick);
      if Terminate then
        TerminateScript;
    end;
    You will have to edit it a bit to get it to work but it is cool when you get it working. Make sure you have the sound on


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  6. #6
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Scaper View Post
    SCAR Code:
    program New;


    begin
      GetApplication.MessageBox('thank you for using','ya',0);
      wait(1500);
      begin
        GetApplication.MessageBox('plz use again soon','ya',0);
      end;
    end.

    yer that way works quite good actualy

    showmeesage is meesed up wont even deplay it
    I told ya
    Verrekte Koekwous

  7. #7
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yer i know id already posted it tho when ya told ma.
    but this is better you can choose the size infact I'm going to update it so you can do bold =]

    Edit: changed it try it now ;-]
    Blank!

  8. #8
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default


  9. #9
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ha n3ss3s that piece of shit.

    hardly works for anyone and doesn't have many options =]

    Edit: IMHO this pwnz0rz ShowMessage =]
    Blank!

  10. #10
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    People usually don't be so... 'loud' about their own functions.

    Maybe because it's so good, you should link Freddy to this thread so that he'd be convinced about how your one owns his 'shit' ShowMessage.

  11. #11
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol, mine may not look as tidy but it has more functonality =]

    Edit: Anyway why cant you just humour me and make me feel good for once. =]

    Edit2: The reason im so "loud" about it is because it is possibly the first real thing that could be good for SRL. =]
    Blank!

  12. #12
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    I really don't know what humouring means so I won't, but how would you feel like if Freddy came here and said - "Haha, shitty lil function, SCAR 3.16 has a new ShowMessage that gives you a cookie!"? Bad.

    Also, what do you mean by this being the first useful thing for SRL?

  13. #13
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    WTF is this all about? Its a stupid little message box that can be made to appear in 3 different ways... whats so exciting??? Lol

  14. #14
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I mean it could be the most beneficial thing ive ever done for SRL =]
    and humouring some one just means to like go along with it to make them happy. =]

    And if Freddy makes a better one then ill be happy cos mine spurred him on to give out free cookies. =]
    Blank!

  15. #15
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    I mean it could be the most beneficial thing ive ever done for SRL =]
    and humouring some one just means to like go along with it to make them happy. =]

    And if Freddy makes a better one then ill be happy cos mine spurred him on to give out free cookies. =]
    .. I'm outta this thread.

    Hippies...

  16. #16
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Why no matter what i do is no one ever happy =[ what can i do that you would like.

    Not something ridiculously stupidly hard.

    Come on atleast i try. =[
    Blank!

  17. #17
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    You don't have to do anything, and for the goal of making something that's good for SRL, I suggest you try some runtime thing, because SRL is for macroing, usually long periouds, and I doubt people like to see tons of message boxes in the morning =D


    You should also add FreeForm.

  18. #18
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    N3ss3s i was thinking more for final reports and things like "you don't have a stats account go here to get one" etc.
    Blank!

  19. #19
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Kick it to SRL Functions? This doesn't sound like something for in SRL imo, more for in scripts..
    I made a new script, check it out!.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Message of the Day...
    By R0b0t1 in forum News and General
    Replies: 11
    Last Post: 12-18-2007, 02:18 AM
  2. message
    By macromacro123 in forum OSR Help
    Replies: 2
    Last Post: 03-04-2007, 09:44 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
  •