June 06, 2020, 04:32:42 am

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Why is it beeping!

Started by Brian, May 10, 2020, 06:11:02 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

May 10, 2020, 06:11:02 am Last Edit: May 10, 2020, 09:28:29 am by Brian
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

LarryMc

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.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Thanks, Larry - I will take a look at doing it that way

Brian

LarryMc

actually, I think I set it up so there is one callback sub for EACH control tab and shift tab
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

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