RE: EditText Style: ES_NUMERIC
- Posted by Brian Broker <bkb at cnw.com> Jan 29, 2003
- 399 views
Guess what! You've just found another reason why exw.exw should have a subsystem version of 4.0. I tested your program with the original exw.exw with a subsystem version of 3.1 and it doesn't work like it should (anything can be entered). You should make a backup copy of exw.exe before running this program that was submitted to the mailing list by Robert: -- set Windows GUI version include file.e include get.e constant new_version = {4,0,0} -- or {3, 0, 10} for 3.1 integer fn fn = open("exw.exe", "ub") if seek(fn, #C8) != 0 then puts(2, "1st seek failed\n") abort(1) end if puts(2, "Initially:\n") ? get_bytes(fn, 3) if seek(fn, #C8) != 0 then puts(2, "2nd seek failed\n") abort(1) end if puts(fn, new_version) puts(1, "Now:\n") ? new_version close(fn) -- end of program -- Try it with your new version of exw.exe... -- Brian jordah wrote: > What version of win32lib? This also fails to work when i use euwin. i'm > perplexed!! > > > ----- Original Message ----- > From: <jordah at btopenworld.com> > To: "EUforum" <EUforum at topica.com> > Sent: Tuesday, January 28, 2003 5:41 PM > Subject: EditText Style: ES_NUMERIC > > > > Hi, > > I've been coding an App using win32lib but i noticed something was > wrong. > > If i use ES_NUMERIC i no longer get the "Number only sle". it allows > > other > > characters as well. I'm using XP. Its probably the bit-flags in wrong > order > > or XP issue(which i doubt). I could probably fix this with > > SetWindowLong() > > but its not worth it if some one else knows why. > > > > Jordah > > > > -- example7.exw > > -- > > -- This creates two editable controls, > > -- and buttons to query their control's values > > > > include win32lib.ew > > without warning > > with trace > > constant > > Win = create( Window, "Get Data", 0, Default, Default, 400, 200, > > 0 ), > > > > Check1 = create( CheckBox, "checkbox", Win, 10, 10, 80, 20, 0 ), > > Button1 = create( PushButton, "Check Value...", Win, 180, 10, 120, 20, > > 0 ), > > > > Sle1 = create( EditText, "", Win, 10, 40, 120, 20, ES_NUMERIC ), > > Button2 = create( PushButton, "Check Value...", Win, 180, 40, 120, 20, > > 0 ) > > > > constant > > aStatusBar = create( StatusBar, "", Win, 0, 25, 20, 20, 0) > > > > procedure Click_Button(integer self, integer event, sequence parms) > > sequence msg > > > > if self = Button1 then > > if isChecked( Check1 ) then > > msg = "Checked: Yes" > > else > > msg = "Checked: No" > > end if > > else > > msg = getText(Sle1) > > end if > > > > setText(aStatusBar, msg) > > end procedure > > > > setHandler({Button1, Button2}, w32HClick, routine_id("Click_Button")) > > > > WinMain( Win, Normal ) > > > >