[futurebasic] RE: [FB] exit push button problem!

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2000 : Group Archive : Group : All Groups

From: GonsalvesML@...
Date: Thu, 10 Feb 2000 12:06:33 -0500
Joe,
Thanks for the reply.  I've tried the following things:

1. I've tried
 
BUTTON 20,_activeBtn,"Exit",(430,100)-(490,150),_shadow
local fn statusBar'Beeps when mouse is clicked
Beep:Beep
end fn

It quits the window before it even opens it.

2.  BUTTON 20,_activeBtn,"Exit",(430,100)-(490,150),_shadow
local fn statusBar'Beeps when mouse is clicked
Beep:Beep
end fn
if DlgEV% = _activeBtn THEN end

This doesn't do it.

3.  local fn HandleDialog
'---> Variables
DIM EditStr$,DlgEV%,DlgID%
'---> Get Event Info
DlgEV% = DIALOG(20)
DlgID% = DIALOG(DlgEV%)
'---> Quit on Close Window
IF DlgEV% = _activeBtn THEN gQuit% = _true 
end fn
end

It doesn't do it!




I'm still trying at this point!:-)





// === Globals
====================================================================

'---> Constants


'enter key ASCII
'return key ASCII




begin globals

dim hour%, minute%, second%
dim err%
dim t$
dim t%
dim thestep%
dim counter%
dim endValue%
dim startValue%
dim Dat$
dim gNowSeconds
dim dateRecord
dim txtSize%
dim ptr&
dim temp$
dim gQuit%
dim DlgEV%

dim x% as int
dim gUncheckedTime% as int
Dim gCheckedTime% As int
dim closeBtn% as int
dim CDEF
dim if

end globals




WINDOW 1,"Pacific Crest",(0,0)-(500,300),_docNoGrow


BUTTON 20,_activeBtn,"Exit",(430,100)-(490,150),_shadow
local fn statusBar'Beeps when mouse is clicked
Beep:Beep
end fn
if DlgEV% = _activeBtn THEN end


poke( ptr& + 2 ), 65
text _applFont, 12, 48, 0

call textSize ( txtSize% )
txtSize% = 12700

'include "tlbx speechsynthesis.incl"
't$ = str$(USR second)
'err = fn speakstring(t$)


do


Edit field 2,"", (60,180)-(403,250),_statFramed, _centerJust 'draw optional
2-pixel border
DIM aRect.8
CALL SETRECT(aRect, 60, 180, 403, 250)       'define initial rectangle
EDIT FIELD 2,"", @aRect,_statFramed, _centerJust
CALL INSETRECT (arect, -2, -2)          ' resize aRect 2 pixels larger all
around 
DEF BORDER (_true, aRect)               ' make border using arect coordinates
CALL INSETRECT (arect, 2, 2)            ' put back to original size
call iutimestring([_time], _true,t$)
print %(180,140);t$
Call IUDATESTRING([_time] , _LongDate , Dat$)
print %(10,20);Dat$
call IUTIMESTRINg([_time], _true, t$)
print "The time is now ";t$



'COMPILE LONG if def _usingLiteRuntime = _false

'compile end if
'long if fn SpeechManagerVersion => 0
'FN SpeakString ("It is.")
'while FN SpeechBusy
'wend
'FN SpeakString (t$)
'end if
  


'--------- Begin Program ------

COMPILE  0,_dimmedVarsOnly

'--------- Globals ------------





'--------- Functions ----------




gUncheckedTime% = 80'<-- Adjust value of this global to set how long 
 'each box will remain unchecked
gCheckedTime% = 140'<-- Adjust value of this global to determine when 
 'each box will be checked

      'These button constants are listed for reference only
      'They are predefined in FB as CDEF checkboxes
      'See FB^3 Reference Manual Pages 53 and 54
      '_CDEFBaseID = 128
     '_checkBox2 = 2
 
    '_CDEFnoOutline = 4
FOR x% = 1 TO 10
select case
Case x% = 1
button 1, 1, "", (85,200)-(115,225), 128+2+4'All the following are FB^3 

Delay gUncheckedTime%
button 1, 2, "", (85,200)-(115,225), 128+2+4
Delay gCheckedTime%
case x% = 2
button 2, 1, "", (114,200)-(144,225), 128+2+4
Delay gUncheckedTime%
button 2, 2, "", (114,200)-(144,225), 128+2+4
Delay gCheckedTime%
case x% = 3
button 3, 1, "", (143,200)-(173,225), 128+2+4
Delay gUncheckedTime%
button 3, 2, "", (143,200)-(173,225), 128+2+4
Delay gCheckedTime%
case x% = 4
button 4, 1, "", (172,200)-(202,225), 128+2+4     
Delay gUncheckedTime%
button 4, 2, "", (172,200)-(202,225), 128+2+4
Delay gCheckedTime%
case x% = 5
button 5, 1, "", (201,200)-(231,225), 128+2+4
Delay gUncheckedTime%
button 5, 2, "", (201,200)-(231,225), 128+2+4
Delay gCheckedTime%
Case x% = 6
button 6, 1, "", (230,200)-(260,225), 128+2+4
Delay gUncheckedTime%
button 6, 2, "", (230,200)-(260,225), 128+2+4
Delay gCheckedTime%
case x% = 7
button 7, 1, "", (259,200)-(289,225), 128+2+4
Delay gUncheckedTime%
button 7, 2, "", (259,200)-(289,225), 128+2+4
Delay gCheckedTime%
case x% = 8
button 8, 1, "", (288,200)-(318,225), 128+2+4
Delay gUncheckedTime%
button 8, 2, "", (288,200)-(318,225), 128+2+4
Delay gCheckedTime%
case x% = 9
button 9, 1, "", (317,200)-(347,225), 128+2+4
Delay gUncheckedTime%
button 9, 2, "", (317,200)-(347,225), 128+2+4
Delay gCheckedTime%
case x% = 10
button 10, 1, "", (346,200)-(376,225),128+2+4
Delay gUncheckedTime%
button 10, 2, "", (346,200)-(376,225), 128+2+4
Delay gCheckedTime%
end select
NEXT


for closeBtn% = 1 to 10'This for/next loop closes the checkboxes
button close closeBtn%
next closeBtn%



until if DlgEV% = _activeBtn Then gQuit% - _true
end 

LOCAL FN buildWind'Creates window with edit field








fn statusBar'Calls the statusBar function above

end fn

local fn HandleDialog
'---> Variables
DIM EditStr$,DlgEV%,DlgID%
'---> Get Event Info
DlgEV% = DIALOG(20)
DlgID% = DIALOG(DlgEV%)
'---> Quit on Close Window
IF DlgEV% = _activeBtn THEN end
end fn




'--------- Main Loop ----------

on Dialog fn HandleDialog
do
long if fn button
fn statusBar
xelse
end if
handleevents
'or fn button
until gQuit%
end

'--------- End Program ---------