Richtext in DialogEx Withg Key ESC

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Kier
    Forum Member
    • Feb 2006
    • 29

    Richtext in DialogEx Withg Key ESC

    hello,

    I have a Richtext Window on a DialogEX Screen. If Richtext is focused (the cursor is in) and press Escape the DialogEx Screen hangs. No objects in the DialogEx Screen can't select.
  • Cybergraph
    Indigo Rose Customer
    • Feb 2007
    • 1633

    #2
    ESC closes the dialog: this is the standard behavior of Windows dialog boxes, not AMS.

    What's wrong?
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.

    Comment

    • Kier
      Forum Member
      • Feb 2006
      • 29

      #3
      Yes, normal close the DialogEX, but if i am in the Richtext box and press esc the dialogex box hang and doesnt close.

      Comment

      • Darryl
        Indigo Rose Staff Member
        • Jul 2001
        • 1908

        #4
        We'll look into the issue you described.
        REF: AMS-556

        Comment

        • Kier
          Forum Member
          • Feb 2006
          • 29

          #5
          Hello,

          Here ist the Problem. Exists a hint to bypass the ESC key?

          My Project - Richtex on DialogEx.apz

          Comment

          • Kier
            Forum Member
            • Feb 2006
            • 29

            #6
            Ah ou.. the Plugin helped me out.
            KeyLock.EnableKey(27, false); on DialogEx event Preload.
            If Richtext Focused and the Cursor is in the rtfbox and press ESC. DialogEX Window works normal.

            Comment

            • Kier
              Forum Member
              • Feb 2006
              • 29

              #7
              Originally posted by Kier View Post
              Ah ou.. the Plugin helped me out.
              KeyLock.EnableKey(27, false); on DialogEx event Preload.
              If Richtext Focused and the Cursor is in the rtfbox and press ESC. DialogEX Window works normal.
              Mean http://www.indigorose.com/forums/thr...hlight=keylock

              Comment

              • Kier
                Forum Member
                • Feb 2006
                • 29

                #8
                OK,
                My last sol. was not very good. If KeyLock Escape set to false, it disabled complet the System.

                My current solution is:
                Code:
                - On every Dialog Box where i have set a Richtext object, created a input object named 'ECS_Fake' (size2x2 pixel, using color from back and the same for front)
                - Dialog Box event 'preload'
                
                [FONT="System"]	RTFCode_Posn = RichText.GetPos("RichText1");
                	RTFCode_Size = RichText.GetSize("RichText1");[/FONT]
                
                - Dialog Box even 'on Mouse Move' 
                [FONT="System"]Disable_Enable_EscKey("RichText1",RTFCode_Posn,RTFCode_Size);[/FONT]
                
                - In the 'Global Functions'
                [FONT="System"]
                function Disable_Enable_EscKey(oFocus,RTFCode_Posn,RTFCode_Size)
                	local esc = KeyLock.IsKeyEnabled(27);
                	
                	if (e_X>=RTFCode_Posn.X) and (e_X<=RTFCode_Posn.X+RTFCode_Size.Width) and (e_Y>=RTFCode_Posn.Y) and (e_Y<=RTFCode_Posn.Y+RTFCode_Size.Height) then
                		if (esc==true) then -- Disable ESC Key ,we are in the RichText
                			KeyLock.EnableKey(27, false);
                			DialogEx.SetFocus(oFocus)
                			Input.SetProperties("ESC_Fake", {Enabled=false,Visible=false})
                		end
                	else
                		if (esc==false) then -- Enable ESC Key
                			KeyLock.EnableKey(27, true);
                			Input.SetProperties("ESC_Fake", {Enabled=true,Visible=true})
                			DialogEx.SetFocus("ESC_Fake")
                			Input.SetProperties("ESC_Fake", {Enabled=false,Visible=false})	
                		end
                	end
                end[/FONT]
                It disabled now the esc key if the mouse over the Richtext Object is and if the Mouse outside from Richtext Enabled the ESC Key and at the same time Focused the Input Object 'ESC_Fake'.

                Comment

                • Kier
                  Forum Member
                  • Feb 2006
                  • 29

                  #9
                  Change to and edit
                  if (e_X>=RTFCode_Posn.X-1) and (e_X<=RTFCode_Posn.X+RTFCode_Size.Width) and (e_Y>=RTFCode_Posn.Y-2) and (e_Y<=RTFCode_Posn.Y+RTFCode_Size.Height) then

                  Comment

                  Working...
                  X