IonicWind Software

IWBasic => IWMask => Topic started by: Brian on May 10, 2020, 06:11:02 AM

Title: Why is it beeping!
Post by: Brian on May 10, 2020, 06:11:02 AM
Larry,

I'm using your IWMask lib, and am wondering why it always beeps when entering data into the date fields. Any idea?

Also, I have two IWMask date fields, along with another, normal edit box, in a Dialog. The normal edit box does tab (it's the first one), but I can't get the tabbing to move onto the next two IWMask edit boxes

Brian

' Test of IWMask

autodefine "off"

$include "windowssdk.inc"
$include "iwmask.inc"

WINDOW win
ISTRING myDate[32]

CONST COLOR_BTNFACE=15

OPENWINDOW win,0,0,300,300,@MINBOX|@MAXBOX|@SIZE,0,"IWMask Test",&main
CONTROL win,@BUTTON,"OK",20,170,70,20,0x50000000,100
SETWINDOWCOLOR win,GetSysColor(COLOR_BTNFACE)

IWM_Create(win,120,20,102,100,22,0,"D\ate: 00/00/0000","_")
SETFONT win,"MS Sans Serif",8,400,0,120

IWM_Create(win,130,20,132,100,22,0,"D\ate: 00/00/0000","_")
SETFONT win,"MS Sans Serif",8,400,0,130

SETFOCUS win,120

WAITUNTIL IsWindowClosed(win)
END

SUB main(),INT
SELECT @MESSAGE
CASE @IDCREATE
CENTERWINDOW win
CASE @IDCLOSEWINDOW
CLOSEWINDOW win
CASE @IDCONTROL
SELECT @CONTROLID
CASE 100
myDate=IWM_GetMinText(win,120)
SETCAPTION win,myDate
ENDSELECT
ENDSELECT
RETURN 0
ENDSUB
Title: Re: Why is it beeping!
Post by: LarryMc on May 10, 2020, 11:27:20 AM
Off the top of my head I don't have any answers. I haven't even thought about that lib since way back when I created it. Give me a little time to look into it.
Title: Re: Why is it beeping!
Post by: LarryMc on May 11, 2020, 10:30:26 PM
QuoteI'm using your IWMask lib, and am wondering why it always beeps when entering data into the date fields. Any idea?
No idea. There's no beeping on my computer.

The quickest solution I can see for the tabbing is to use two callback functions that are built into the lib:
**********************************************************************
IWM_SetTabCallback(WINDOW win, UINT id, uint callback)
Called when the TAB key is pressed

global sub MySub1(int hwnd, int id) ' can be any name you prefer
  'use a series of if/else
     GetFocus(GetControlHandle(hwnd,id))=xx then SetFocus(yy)

   return
endsub

****************************************************************************
the same sort of setup for tabbing backwards
IWM_SetShiftTabCallback(WINDOW win, UINT id, uint callback)
Called when the SHIFT-TAB key is pressed
global sub MySub2(int hwnd, int id)

   return
endsub
Title: Re: Why is it beeping!
Post by: Brian on May 12, 2020, 02:44:51 AM
Thanks, Larry - I will take a look at doing it that way

Brian
Title: Re: Why is it beeping!
Post by: LarryMc on May 12, 2020, 06:36:44 AM
actually, I think I set it up so there is one callback sub for EACH control tab and shift tab
Title: Re: Why is it beeping!
Post by: Brian on May 15, 2020, 04:19:25 AM
Well, this is as far as I've got. Still not tabbing correctly, and I don't know how to fix it

If anyone has a look, I am still getting a bong when I try to insert numbers into the date field

Brian
Title: Re: Why is it beeping!
Post by: LarryMc on June 06, 2020, 02:06:40 PM
I've sent you an email and a test lib to try out.
Let me know the results.
Each mask control you create will have a tab sub and in that sub all you need to do
is use the SETFOCUS command to the control you want to go  to.
Same for the ALT-TAB sub.

LarryMc