1. Re: Win32lib copy() multiple fields??

On Fri, 11 Aug 2000 18:25:15 -0400, I wrote:

>I'll whip up another demo if you'd like...

Ahhh... what the heck, here it is:

include win32lib.ew
without warning

constant
  Win = create( Window, "Copy demo #2", 0, Default, Default, 280, 200, 0 ),
  Box1 = create( EditText, "Brian Broker", Win, 50, 5, 200, 20, 0 ),
  Txt1 = create( LText, "Name:", Win, 5, 8, 40, 20, 0 ),
  Box2 = create( EditText, "666 Mockingbird Lane", Win, 50, 30, 200, 20, 0),
  Txt2 = create( LText, "Address:", Win, 5, 33, 40, 20, 0 ),
  Box3 = create( EditText, "Seattle", Win, 30, 55, 50, 20, 0 ),
  Txt3 = create( LText, "City:", Win, 5, 58, 20, 20, 0 ),
  Box4 = create( EditText, "WA", Win, 120, 55, 30, 20, 0 ),
  Txt4 = create( LText, "State:", Win, 90, 58, 30, 20, 0 ),
  Box5 = create( EditText, "12345", Win, 210, 55, 40, 20, 0 ),
  Txt5 = create( LText, "Zip Code:", Win, 160, 58, 50, 20, 0 ),
  Box = create( MleText, "", Win, 5, 5, 285, 120, 0 ),
  Btn = create( PushButton, "Copy to clipboard", Win, 5, 135, 100, 30, 0 )

-- I would normally put the next line in onOpen[Win] but I'm lazy
setVisible( Box, False )

procedure onClick_Btn()
  atom result
  sequence address

  -- put info into a sequence
  address = { getText( Box1 ),
              getText( Box2 ),
              getText( Box3 ),
              getText( Box4 ),
              getText( Box5 ) }

  -- arrange address in hidden MleText box
  setText( Box, sprintf( "%s\r\n" &
                         "%s\r\n" &
                         "%s, %s  %s", address ) )

  -- select info from MleText box
  result = sendMessage( Box, EM_SETSEL, 0, -1 )
  -- copy info from Box
  copy( Box )
end procedure
onClick[Btn] = routine_id( "onClick_Btn" )

----------------------
WinMain( Win, Normal )
----------------------

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu