Results 1 to 14 of 14

Thread: popup Dlg (with editbox in it output to variable)

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

    Default popup Dlg (with editbox in it output to variable)

    hey

    i want this

    when i click a button
    this must happen
    a DlG(dialog) pop up with a edit box in it you put a site(string) in it and it gets saved in string.

    almost the same as readln in scar

    Hermpie

    @boreas: already thanks
    ~Hermen

  2. #2
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    What's the difference from ReadLn?

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

    Default

    let me say, it's the same as readln but then in delphi, and i don't like it that you always look for this little bug typed text ... i know my english sucks and everyone makes mistakes but i just get pissed of that kinds of things...
    ~Hermen

  4. #4
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    I guess you could make another form, that you load and popup( Form2.Show; ) when you call the function. The form should contain one edit box. After the Button is closed, close the form and free it again.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    thanks! dan told me the same yet to bad they don't got a dialog for it but thanks wizzup?
    ~Hermen

  6. #6
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by hermpie View Post
    thanks! dan told me the same yet to bad they don't got a dialog for it but thanks wizzup?
    Well, if TForm1 is your 'first' form, this could be a usefull procedure.

    SCAR Code:
    procedure TForm1.AddForm(Sender: TObject);

    begin
      Form1.Show; // To replace the ShowModal. (You can't have two ShowModals at the same time...
      Application.CreateForm(TForm2, Form2);
      Form2.ShowModal;
    end;

    And perhaps in your Form2 code:

    SCAR Code:
    procedure TForm2.FreeIt(Sender: TObject; var Action: TCloseAction);
    begin
      //Freeing stuff here.
    end;

    And your Form2.InitForm should just contain the creation of the edit box with a button.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    i need to use this when i want to let show this dialog?
    ~Hermen

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

    Default

    Code:
    function InputQuery(const ACaption, APrompt: string; var Value: string): Boolean;
    function InputQuery(const ACaption, APrompt: WideString; var Value: WideString): Boolean; overload;
    function InputQuery(const ACaption, APrompt: WideString; var Value: string): Boolean; overload;
    function InputQuery(const ACaption, APrompt: WideString; var Value: Double, Min: Double = Low(Integer); Max: Double = High(Integer); Decimals: Integer = 1): Boolean; overload;
    function InputQuery(const ACaption, APrompt: WideString; var Value: Integer, Min: Integer = Low(Integer); Max: Integer = High(Integer); Increment: Integer = 1): Boolean; overload;
    Example: InPutQuery('Find Window', 'Enter the exact name of the window:', str)
    Hup Holland Hup!

  9. #9
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by nielsie95 View Post
    Code:
    function InputQuery(const ACaption, APrompt: string; var Value: string): Boolean;
    function InputQuery(const ACaption, APrompt: WideString; var Value: WideString): Boolean; overload;
    function InputQuery(const ACaption, APrompt: WideString; var Value: string): Boolean; overload;
    function InputQuery(const ACaption, APrompt: WideString; var Value: Double, Min: Double = Low(Integer); Max: Double = High(Integer); Decimals: Integer = 1): Boolean; overload;
    function InputQuery(const ACaption, APrompt: WideString; var Value: Integer, Min: Integer = Low(Integer); Max: Integer = High(Integer); Increment: Integer = 1): Boolean; overload;
    Example: InPutQuery('Find Window', 'Enter the exact name of the window:', str)
    Hmm, that line seems familiar
    Administrator's Warning:


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

    Default

    can you give an example?
    ~Hermen

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

    Default

    SCAR Code:
    const
      a = 'website';
      b = 'what is the name of the website';
    var
      c: string;
    procedure ask;
    begin
      InputQuery(a, b, c);
      edit.text := c
    end;

    EDIT: yep that example works
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


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

    Default

    i yet made a cool form for it...

    can some1 tell me why i can't see the 'childs on form2'
    SCAR Code:
    Form2.Show;
     Link1.Caption:=(GetBetween(Site,'.','.'));

    got that in it
    the form compiles i can see form2 but not the childs

    ps. can some1 fix this

    SCAR Code:
    Function HWait (MaxTime:Integer; HUntil:Boolean): Boolean;
    Var
      Time : Integer;
    Begin
      MarkTime(Time);
      Repeat
        Wait(100 + Random(50));
      Until HUntil or (TimeFromMark(Time) > MaxTime);
    End;
    for scar, so you can fill in somthing like infight; or bankscreen; (in HUntil)
    ~Hermen

  13. #13
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    program New;

    function Bool: Boolean;
    begin
      Result:= Random(100) = 0;
    end;

    procedure HWait(MaxTime: Integer; HUntil: Function: Boolean);
    var
      T: Integer;
    begin
      T:= GetSystemTime;
      while not HUntil() and not(GetSystemTime - T > MaxTime) do
        wait(50);
    end;

    begin
      HWait(5000, @Bool);
    end.
    Something like that?

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

    Default

    Wrong thread and WTF?(not blaming you)
    no thats not what i mean check other thread
    ~Hermen

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Won't output (usually non ASCII) text. Not even the question marks.
    By R0b0t1 in forum Delphi/FPC Help and Tutorials
    Replies: 7
    Last Post: 07-18-2008, 02:26 AM
  2. Advanced Keyboard Output...
    By stein3 in forum OSR Help
    Replies: 1
    Last Post: 02-17-2008, 04:20 AM
  3. weird java program output...
    By sherlockmeister in forum Java Help and Tutorials
    Replies: 1
    Last Post: 10-03-2007, 02:47 AM

Posting Permissions

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