Re: [Win32Lib] ComboBox drop-down doesn't move with window

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

o, o, I figured it out myself!  (with a little help from somewhere in the
bowels of MicroSoft: CB_GETDROPPEDSTATE )

Dan Moyer

--<begin code>
--  code generated by Win32Lib IDE v0.14.2

include Win32lib.ew
without warning

----------------------------------------------------------------------------
----
--  Window Window1
constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400,
300, 0, 0 )
constant Combo2 = createEx( Combo, "Combo2", Window1, 44, 64, 148, 420*6, 0,
0 )
constant Combo4 = createEx( Combo, "Combo4", Window1, 208, 64, 148, 20*6, 0,
0 )
---------------------------------------------------------
----------------------------------------------------------------------------
----
object dummy

----------------------------------------------------------------------------
----
procedure Window1_onPaint (integer self, integer event, sequence
params)--params is ( int x1, int y1, int x2, int y2 )
int result

  result = sendMessage ( Combo2, CB_GETDROPPEDSTATE , 0, 0 )
  if result = 1  then
       dummy = sendMessage(Combo2, CB_SHOWDROPDOWN, False,0)
       dummy = sendMessage(Combo2, CB_SHOWDROPDOWN, True,0)


  end if

  result = sendMessage ( Combo4, CB_GETDROPPEDSTATE , 0, 0 )
  if result = 1  then
       dummy = sendMessage(Combo4, CB_SHOWDROPDOWN, False,0)
       dummy = sendMessage(Combo4, CB_SHOWDROPDOWN, True,0)


  end if
end procedure
setHandler( Window1, w32HPaint, routine_id("Window1_onPaint"))
----------------------------------------------------------------------------
----
procedure Window1_onActivate (integer self, integer event, sequence
params)--params is ()
  for n = 1 to 5 do
   addItem( Combo2, "Item" & sprint(n) )
  end for

    dummy = sendMessage(Combo2, CB_SHOWDROPDOWN, False,0)
  dummy = sendMessage(Combo2, CB_SHOWDROPDOWN, True,0)
    setIndex( Combo2, 1 )

  for n = 1 to 5 do
    addItem( Combo4, "Item" & sprint(n) )

  end for
   setIndex( Combo4, 1 )

end procedure
setHandler( Window1, w32HActivate, routine_id("Window1_onActivate"))


WinMain( Window1,Normal )

--<end code>

----- Original Message -----
From: "Dan Moyer" <DANIELMOYER at prodigy.net>
To: "EUforum" <EUforum at topica.com>
Sent: Tuesday, January 28, 2003 7:05 PM
Subject: Re: [Win32Lib] ComboBox drop-down doesn't move with window


>
> Ok, "onLostFocus" doesn't work as a trap when moving a window, but onPaint
> the window, with CB_SHOWDROPDOWN, False,0, will close the drop-down;
> however, what if I have more than one combo, & would like them to just
> remain as they happen to be, up if up, down if down, when moving the
window?
> In other words, how can I find out whether a combo has its list dropped
down
> or not?
>
> Dan Moyer
>
> ----- Original Message -----
> From: "Dan Moyer" <DANIELMOYER at prodigy.net>
> To: "EUforum" <EUforum at topica.com>
> Sent: Tuesday, January 28, 2003 4:08 PM
> Subject: Re: [Win32Lib] ComboBox drop-down doesn't move with window
>
>
> > Feature indeed! :)
> >
> > In the meantime, should I just use an "onLostFocus" event for the combo
to
> > close the list?
> >
> > Didn't you just come back from vacation?
> >
> > Dan
> >
> > ----- Original Message -----
> > From: "Derek Parnell" <ddparnell at bigpond.com>
> > To: "EUforum" <EUforum at topica.com>
> > Sent: Tuesday, January 28, 2003 3:14 PM
> > Subject: Re: [Win32Lib] ComboBox drop-down doesn't move with window
> >
> >
> > > On Tue, 28 Jan 2003 14:07:24 -0800, Dan Moyer
<DANIELMOYER at prodigy.net>
> > > wrote:
> > >
> > > >
> > > > Below is a demo of a problem I've encountered with combo-boxes:
> > > >
> > > > if I make the list drop-down, & then move the window, the drop-down
> list
> > > > remains where it was instead of moving with the window, though it is
> > > > still
> > > > functional.  Both combos in the demo exhibit the problem, the first
is
> > > > "auto" drop-downed, the second has the same problem if the user
clicks
> > on
> > > > the drop-down arrow & then moves the window.
> > > >
> > > > Is this a bug?  What's the best way to fix this?
> > >
> > > Bug?!?! No this is a feature blink
> > >
> > > Actually, what win32lib should be doing is when a combo loses focus, a
> > > message should be sent to it to close-up the dropdown list. I'll add
> this
> > > to the list of items to improve win32lib.
> > >
> > > --
> > >
> > > cheers,
> > > Derek Parnell
> > >

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

Search



Quick Links

User menu

Not signed in.

Misc Menu