English
Forum

input-mask

 

rquindt
Hello

gives it a Possibility, with the input a default-mask To use?

i want z.B. with of/ one Datumseingabe "12.05.2016" pretending.
with the input should only numbers allows his and on whom to put, on them the "." is, to the Kursor this automatically skipping.

an second Version true "2X". dh. on the first place must only "0-9" association go, on the second only "A-Z"
 
05/01/16  
 




H.Brill
to Datumseingabe would I the DateEdit use.
there can you one date pretending.
See chapter 20.5 in the Help.

to Version 2 :
there could to the Editfeld subclassen and
with the regulären squeeze out works.
Suchmuster the first place : "[0-9]"
Suchmuster the second place : "[A-Z]"
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
05/01/16  
 




rquindt
Hello H.Brill

thanks for hint with the DateEdit.
I have it time tested, functions lovely.

gives it The Possibility, too one leeres Datumsfeld To transfer without
the the actually date appear? (00.00.0000)

Since I me so slow in XProfan einarbeite (have before in DOS Powerbasic program)
is me with the the SubClassen not yet integrally clear.
would have You there an example for me?
 
05/01/16  
 




H.Brill
for the SubClassen time one beginning :
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
05/01/16  
 




rquindt
Hello H.Brill

I have your Sourcecode time a little bit rebuilt.
so can I now by SubClassing the Edit-area Edit.
whom code have I as File abgespeichert.

I have attempts whom code here einzufügen,
but thereby goes The Formatierung lost.
gives it a guide,How to the bypassing?

can You you my code time standing?
Can yet what optimize?

$H Messages.ph
$H windows.ph
Def GetSysColor(1) !"USER32","GetSysColor"

cls GetSysColor(15)
UseFont "Arial",15,0,0,0,0
SETDIALOGFONT 1

Declare lever Edit1, Btn1
Declare Int end, String edittext, ErlaubteZeichen
Window 400, 200
Edit1 = Create("Edit", %HWnd, "", 10, 50, 80, 20)
SetStyle Edit1, GetStyle(Edit1) | ~ES_UPPERCASE '--- letters only as Großbuchstaben spend
@SendMessage(Edit1,$00C5,2,0) '--- Parameter 3 allows amount max. to put

btn1 = Create("Button", %HWnd, "ready", 10, 80, 60, 25)

end = 0

User Messages $10
SetFocus(Edit1)
SubClass Edit1, 1

WhileNot end

WaitInput
If Clicked(btn1)
edittext = GetText$(Edit1)
Messagebox(edittext, "", 0)
SetFocus(Edit1)
EndIf

Case %UMessage = $10 : end = 1 '--- Window close angeclickt

EndWhile

SubClass Edit1, 0

End

SubclassProc

Declare p&, ch$, s$

if &sWnd = Edit1
if %sMessage=258//wm_char
p& = Hiword(sendMessage(Edit1,$B0,0,0))//em_getSel '--- actually Cursor-position (only slot) imEditfeld
s$ = getText$(Edit1) '--- bisheriger Text in Edit
ch$ = upper$(chr$(&swParam)) '--- letztes eingegebenes characters, Asci-code, in Großbuchstaben gewandelt

If p& = 1
ErlaubteZeichen = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Else
ErlaubteZeichen = "0123456789"
EndIf

ifnot instr(ch$,ErlaubteZeichen) '--- if the latest squeezed characters not the list corresponds to
If &swParam = 8 '--- Backspace / delete
if p&
s$ = Del$(s$,p&,1) '--- area on Cursorposition delete
dec p&,1
endif
EndIf
SetText Edit1,s$ '--- String on Edit-area transfer
sendMessage(Edit1,$B1,p&,p&)//em_setSel '--- new Cursor-position determine
else
s$ = in that$(ch$,s$,p& + 1) '--- input on Cursor+1 insert
s$=Mid$(s$,1,2) '--- only the first 2 characters take, if input longer his ought to through insert
setText Edit1,s$ '--- String on Edit-area transfer
sendMessage(Edit1,$B1,p&+1,p&+1)//em_setSel '--- new Cursor-position determine
endif
set("winproc",0)
endif
EndIf

ENDPROC

 
05/05/16  
 




Michael
W.
i was time so spare...

mind the exclamation points behind the CODE-day.

the double If can supplant go through
If SubClassMessage(Edit1, 258)//wm_char

 
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
05/05/16  
 




rquindt
Hello Michael

thanks for hint
I habs changed.

How get one because whom code readable in that Forum?
 
05/05/16  
 




Michael
W.
About the Editfeld standing "Beitrag|Schrift|Smilies|ein Pfeil". with letzterem dial You simply View source and fügst there your Source one. If the first characters directly behind the öffnenden Klammer one "!" is, then becomes the code leave How he's.
 
Alle Sprachen
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
05/05/16  
 




rquindt
thanks for hint.
I habs same time tested. ought to at next time no
Problems More give.

can man really several SubClassing routines benefit ( apiece Editfeld naturally only a) or can of XProfan only a manages go?
 
05/06/16  
 




Jörg
Sellmeyer
"Es can only a give!"

but the is vielseitig. You can in your SubClassProc Yes different Contols address and the too yet according to Message different treat.
if &sWnd = Edit1

    if %sMessage=258//wm_char

        SetMenuItem 4000

    elseif %sMessage=xxx//wm_...

        SetMenuItem 4001

    Endif

Elseif &sWnd = Edit2

    if %sMessage=258//wm_char

        SetMenuItem 4001

    Elseif %sMessage=xxx//wm_...

        SetMenuItem 4003

    Endif

EndIf


small Tipp yet: The Help has moreover too detailed Erläuterungen of Roland.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/06/16  
 




p.specht

Hab´ mir´s to XProfan11 portiert - I hope, this is OK for you:
'SubclassProc to Festlegung of Eingabemöglichkeiten
'2016-05 of rquint with important Posts of H.Brill, Michael W.
'and Jörg Sellmeyer, 2018-12 on XProfan11 zurückgequält of p.woodpecker
 $H Messages.ph
 $H windows.ph
Def GetSysColor(1) !"USER32","GetSysColor"
Cls GetSysColor(15)
UseFont "Arial",15,0,0,0,0
SETDIALOGFONT 1
Declare Edit1&, Btn1&
Declare ende&, edittext$, ErlaubteZeichen$
Window 400, 200
Edit1& = Create("Edit", %HWnd, "", 10, 50, 80, 20)
'--- letters only as Großbuchstaben spend
SetStyle Edit1&, GetStyle(Edit1&) | ~ES_UPPERCASE
'--- Parameter 3 allows amount max. to put:
@SendMessage(Edit1&,$00C5,2,0)
Btn1& = Create("Button",  %HWnd, "Fertig", 10, 80, 60, 25)
ende& = 0
User Messages $10
SetFocus(Edit1&)
SubClass Edit1&, 1

WhileNot ende&

    WaitInput

    If Clicked(Btn1&)

        edittext$ = GetText$(Edit1&)
        Messagebox(edittext$, "", 0)
        SetFocus(Edit1&)

    EndIf

    Case %UMessage = $10 : ende& = 1
    '--- Window close angeclickt

EndWhile

Main:
SubClass Edit1&, 0
End

SubclassProc

    Declare p&, ch$, s$
    ' suggestion of J. Sellmeyer for usage in several Editcontrol-Feldern:
    'if &sWnd = Edit1&
    '    if %sMessage=258//wm_char
    '        SetMenuItem 4000
    '    elseif %sMessage=xxx//wm_...
    '        SetMenuItem 4001
    '    Endif
    'Elseif &sWnd = Edit2&
    '    if %sMessage=258//wm_char
    '        SetMenuItem 4001
    '    Elseif %sMessage=xxx//wm_...
    '        SetMenuItem 4003
    '    Endif
    'EndIf

    if &sWnd = Edit1&

        if %sMessage=258//wm_char

            '--- actually Cursor-position (only slot) in the Editfeld:
            p& = Hiword(sendMessage(Edit1&,$B0,0,0))//em_getSel
            s$ = getText$(Edit1&)'--- bisheriger Text in Edit
            '--- letztes eingegebenes characters, Asci-code, in Großbuchstaben gewandelt
            ch$ = upper$(chr $(&swParam))

            If p& = 1

                ErlaubteZeichen$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

            Else

                ErlaubteZeichen$ = "0123456789"

            EndIf

            '--- If the latest squeezed characters not the list corresponds to:

            ifnot instr(ch$,ErlaubteZeichen$)

                If &swParam = 8'--- Backspace / delete

                    if p&

                        s$ = Del$(s$,p&,1)'--- area on Cursorposition delete
                        dec p&,1

                    endif

                EndIf

                SetText Edit1&,s$'--- String on Edit-area transfer
                sendMessage(Edit1&,$B1,p&,p&)//em_setSel '--- new Cursor-position

            else

                s$ = in that$(ch$,s$,p& + 1)'--- input on Cursor+1 insert
                '--- only the first 2 characters take, if input through insert longer his ought to:
                s$=Mid$(s$,1,2)
                setText Edit1&,s$'--- String on Edit-area transfer
                sendMessage(Edit1&,$B1,p&+1,p&+1)//em_setSel '--- new Cursor-position

            endif

            set("winproc",0)

        endif

    EndIf

ENDPROC

 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
12/09/18  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

13.314 Views

Untitledvor 0 min.
Detlef Jagolski05/17/21
iF10/31/20
Alibre10/21/20
rafl06/29/20
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie