| |
|
|
 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" |
|
|
| |
|
|
|
 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? |
|
|
| |
|
|
|
 H.Brill | for the SubClassen time one beginning :
$H Messages.ph
Declare lever Edit1
Declare Int end, String edittext
Window 400, 200
Edit1 = Create("Edit", %HWnd, "", 10, 10, 80, 20)
end = 0
User Messages $10
SubClass Edit1, 1
WhileNot end
WaitInput
Case %UMessage = $10 : end = 1
EndWhile
SubClass Edit1, 0
SubClassProc
If SubClassMessage(Edit1, ~wm_KeyUp)
edittext = GetText$(Edit1)
Messagebox(edittext, "", 0)
SetFocus(Edit1)
Set("WinProc", 0)
EndIf
ENDPROC
End
|
|
|
| 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
|
 |
|
| |
|
|
|
 Michael W. | i was time so spare...
mind the exclamation points behind the CODE-day.
the double If can supplant go through
|
|
|
| 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? |
|
|
| |
|
|
|
 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. |
|
|
| |
|
|
|
 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? |
|
|
| |
|
|
|
 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.
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 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 12/09/18 ▲ |
|
|
|