Button problem...

new topic     » topic index » view thread      » older message » newer message

I'm trying to make this so that yo type into the WritenJ only when your 
in the edit mode. But I can't seem to get the interpeture to figure out 
which mode it is in so that it dose the right procedures.

sequence lBuffer
lBuffer=""
Journal = create( PushButton, "Journal", Window1, 588, 0, 90, 30, 0 ),
    JWIN = create( Window, "Journal", 0, Default, Default, 252, 336+ 19, 
0 ),
    WritenJ = create( MleText, "", JWIN, 9, 13, 224, 272, 0 ),
    EditJ = create( PushButton, "Ok", JWIN, 16, 292, 90, 30, 0 ),
    JCancel = create( PushButton, "Cancel", JWIN, 124, 292, 90, 30, 0 )
procedure onClick_Journal()
openWindow(JWIN, Normal)
setText( WritenJ, lBuffer )
end procedure
onClick[ Journal ] = routine_id( "onClick_Journal" )

procedure onClick_EditJ()
--in edit mode switch out and save text.
if equal(getText(EditJ) , "Ok" ) then
setText( lBuffer, WritenJ )
setText( EditJ, "Edit" )
--not in edit mode switch with no text.
elsif equal(getText(EditJ), "Edit" ) then
setText( WritenJ, "" )
setText( EditJ, "Edit" )
end if
end procedure
onClick[ EditJ ] = routine_id( "onClick_EditJ" )

procedure onclick_Jcancel()
closeWindow( JWIN )
end procedure
onClick[Jcancel] = routine_id( "onClick_EditJ" )
WinMain( Journal, Normal )

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu