Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with pmCompatible, ExtendedSelection ContainerControl

1 view
Skip to first unread message

Eric Raaen

unread,
Feb 10, 1999, 3:00:00 AM2/10/99
to
There is a problem when using the a pmCompatible, ExtendedSelection
ContainerControl as a DM source in Windows: You are unable to start a
drag from the first or second item. I think it's related to the
left/right mouse button difference in Win vs. OS/2. It works fine with
VAC 3.0 for OS/2 (which uses left button to select and right button to
start a drag). To demonstrate the problem, run the test case and try to
drag "Number 0" or "Number 1". It works fine for "Number 2" - "Number
9"

Here is the test case:

// bug.icc
option ProjectOptions = gen(rtti, yes)
{
option link(linkwithmultithreadlib), link(linkwithsharedlib),
incl(searchpath, "."), define("_X86_"),
lang(nokeyword, "bool"), lang(nokeyword, "true"),
lang(nokeyword, "false"), define("IC_LANG_BOOL", 0),
define("IVB_IMPORT", "_Import"), link(subsystem, "windows", 4,
0)
{
target "bug.exe"
{
source type(cpp) "bug.cpp"
}
}
}

// bug.cpp
#include <iframe.hpp>
#include <icnrctl.hpp>
#include <icnrcol.hpp>
#include <idmhndlr.hpp>

class ContainerFrame : public IFrameWindow
{
public:
ContainerFrame () :
IFrameWindow ("Container Frame"),
#ifdef __OS2__
Cnr (new IContainerControl (1000, this, this)),
#else
Cnr (new IContainerControl (1000, this, this, IRectangle (),
IContainerControl::classDefaultStyle |
IContainerControl::pmCompatible)),
#endif
Col (new IContainerColumn (IContainerColumn::isIconViewText))
{
Cnr->addColumn (Col);
Col->setHeadingText("Name");
IString objName ("Number ");
Cnr->setDeleteObjectsOnClose ();
for (int i = 0; i < 10; ++i)
Cnr->addObject (new IContainerObject (objName + IString (i)));

Cnr->setExtendedSelection ();
IDMHandler::enableDragFrom (Cnr);
Cnr->showDetailsView ();
setClient (Cnr);
show ();
Cnr->show ();
Cnr->setFocus();
}
virtual ~ContainerFrame ()
{
delete Cnr;
}

private:
IContainerControl *Cnr;
IContainerColumn *Col;
};

int main (int argc, char *argv[])
{
ContainerFrame frame;
IApplication::current().run();
}

Eric Raaen

unread,
Feb 10, 1999, 3:00:00 AM2/10/99
to
After further investigation, the problem seems to be with the offset to
the selection: Dragging "Number 4" will drop "Number 2". Here's some
new test code:

// bug.cpp


class ContainerFrame : public IFrameWindow
{
public:

ContainerFrame (bool isSource) :
IFrameWindow (isSource ? "Source" : "Target"),


#ifdef __OS2__
Cnr (new IContainerControl (1000, this, this)),
#else
Cnr (new IContainerControl (1000, this, this, IRectangle (),
IContainerControl::classDefaultStyle |
IContainerControl::pmCompatible)),
#endif
Col (new IContainerColumn (IContainerColumn::isIconViewText))
{
Cnr->addColumn (Col);
Col->setHeadingText("Name");
IString objName ("Number ");
Cnr->setDeleteObjectsOnClose ();

if (isSource)
{


for (int i = 0; i < 10; ++i)
Cnr->addObject (new IContainerObject (objName + IString
(i)));

Cnr->setExtendedSelection ();
IDMHandler::enableDragFrom (Cnr);
}

else
IDMHandler::enableDropOn (Cnr);


Cnr->showDetailsView ();
setClient (Cnr);
show ();
Cnr->show ();
Cnr->setFocus();
}
virtual ~ContainerFrame ()
{
delete Cnr;
}

private:
IContainerControl *Cnr;
IContainerColumn *Col;
};

int main (int argc, char *argv[])
{

ContainerFrame src (true);
ContainerFrame target (false);
IApplication::current().run();
}

0 new messages