It is currently Sat Oct 19, 2019 1:18 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: InputRequester pre-select flag
PostPosted: Fri Jan 09, 2015 2:34 am 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1661
Here is a simple low-priority request:
A new flag for InputRequester (maybe #PB_InputRequester_Select) which will automatically pre-select all the text in the input field.

(We already have a Flags parameter for #PB_InputRequester_Password!)


It is handy for quick InputRequesters with DefaultText, so the user can immediately start typing to replace it. No need to keep hitting Ctrl+A or using the mouse to select every time.

In my experience, it is more common to type over the DefaultText completely, rather than append to the end -- where the cursor currently defaults.

_________________
On GitHub: PB Includes - IDE Tools - Color Themes


Top
 Profile  
Reply with quote  
 Post subject: Re: InputRequester pre-select flag
PostPosted: Fri Jan 09, 2015 6:17 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3678
Location: Berlin, Germany
+1

Also for StringGadget(), such a flag would be nice to have.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: InputRequester pre-select flag
PostPosted: Sat Jan 10, 2015 7:15 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Aug 24, 2005 12:11 pm
Posts: 119
Location: Italia
+1

_________________
Registered User of Purebasic PB4.61 - Artic Report - Purevision


Top
 Profile  
Reply with quote  
 Post subject: Re: InputRequester pre-select flag
PostPosted: Thu Jan 29, 2015 8:07 am 
Offline
Addict
Addict
User avatar

Joined: Fri Apr 12, 2013 1:55 pm
Posts: 1058
Location: just outside of Ferguson
Up until today, I thought that the behavior of the Input Requester in Linux which preselects the default was best.
However a couple of hours ago I implemented a chat program where the user initiates text entry by pressing a key.
That key is captured and passed into the Input Requester as the first character of the user's input.
On Windows® that approach works well, because the text is not preselected, and the user continues to type the chat message naturally without interruption then hits the enter key to send it on its way.
With the preselected requester input on Linux, the second keystroke wipes out the first one which is not nice.
Indeed kenmo, a pre-selection option setting would be a good solution .

_________________
Keep it BASIC.


Top
 Profile  
Reply with quote  
 Post subject: Re: InputRequester pre-select flag
PostPosted: Thu Jan 29, 2015 8:32 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Dec 03, 2011 5:54 pm
Posts: 736
Location: Oldenburg (Germany)
+1

_________________
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2


Top
 Profile  
Reply with quote  
 Post subject: Re: InputRequester pre-select flag
PostPosted: Thu Jan 29, 2015 8:46 am 
Offline
User
User

Joined: Wed Dec 17, 2014 11:54 am
Posts: 49
Good request. :)

I would like to also request that the InputRequester window be larger, too. It's positively small for any meaningful entry, especially on big monitors.


Top
 Profile  
Reply with quote  
 Post subject: Re: InputRequester pre-select flag
PostPosted: Thu Jan 29, 2015 2:46 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Apr 12, 2013 1:55 pm
Posts: 1058
Location: just outside of Ferguson
PB Fanatic wrote:
I would like to also request that the InputRequester window be larger, too. It's positively small for any meaningful entry, especially on big monitors.
I discovered one way to make it wider.
Code:
InputRequester("SOFTWARE","message","string")
InputRequester("SOFTWARE","_______________________message_______________________","string")
InputRequester("SOFTWARE","                                               message                                            ","string")

_________________
Keep it BASIC.


Top
 Profile  
Reply with quote  
 Post subject: Re: InputRequester pre-select flag
PostPosted: Thu Jan 29, 2015 3:02 pm 
Offline
User
User

Joined: Wed Dec 17, 2014 11:54 am
Posts: 49
Doesn't make it wider here. All 3 requesters in your code sample are the same width.


Top
 Profile  
Reply with quote  
 Post subject: Re: InputRequester pre-select flag
PostPosted: Thu Jan 29, 2015 3:05 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Apr 12, 2013 1:55 pm
Posts: 1058
Location: just outside of Ferguson
It must be a Linux (only?) feature.
Sorry about that, but it is good to know about the compiler differences.

_________________
Keep it BASIC.


Top
 Profile  
Reply with quote  
 Post subject: Re: InputRequester pre-select flag
PostPosted: Thu Jul 11, 2019 10:49 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat May 17, 2003 11:31 am
Posts: 6068
Well, we didn't get it in the last four years :-) so is there a way around it? (WinAPI is ok.)

_________________
( PB5.xx Win10 x64 Asrock AB350 Pro4 Ryzen 1600X 32GB RAM Evo 840 GTX1060 )
( The path to enlightenment and the PureBasic Survival Guide right here... )


Top
 Profile  
Reply with quote  
 Post subject: Re: InputRequester pre-select flag
PostPosted: Fri Jul 12, 2019 6:51 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 535
blueznl wrote:
Well, we didn't get it in the last four years :-) so is there a way around it? (WinAPI is ok.)


Maybe u can send a #EM_SETSEL message to do that.
https://docs.microsoft.com/en-us/windows/win32/controls/em-setsel


Top
 Profile  
Reply with quote  
 Post subject: Re: InputRequester pre-select flag
PostPosted: Fri Jul 12, 2019 8:09 am 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1102
Location: Germany::Berlin()
Have fun:
Code:
EnableExplicit

Define EventID
Define Text$

Procedure RequesterCallBack(hWnd, uMsg, wParam, lParam)
  hWnd = FindWindow_("InputRequester",#Null)
  If hWnd
    hWnd = FindWindowEx_(hWnd,#Null,"Edit",#Null)
    If hWnd
      SendMessage_(hWnd,#EM_SETSEL,5,10)
    EndIf
  EndIf

  ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure

If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  ButtonGadget(1,10,10,100,20,"InputReq.",0)
 
  SetWindowCallback(@RequesterCallBack())
 
  Repeat
    EventID=WaitWindowEvent()
    If EventID=#PB_Event_Gadget
      Select EventGadget()
        Case 1
          Text$ = InputRequester("Enter text", "Enter a text:", "Predefined text")
          If Text$
            Debug Text$
          EndIf
      EndSelect
    EndIf
    If EventID = #PB_Event_CloseWindow
      End
    EndIf
  ForEver
EndIf

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye