|
 |
Darren New wrote:
> Patrick Elliott wrote:
>> moving it around), well.. tough luck, because its **not** in any of
>> their damn documentation, anyplace, as far as I could ever find.
>
> Huh. I didn't think that's how design mode works.
>
Well, the documentation is fairly specific about how it does, just not
how to turn it on. Its basically a mode flag, which when turned on,
triggers, "show_grab_handles", and, "disable_control", or something like
the second one. I don't remember the name. In theory, you could also
trip both of those states *in* the control yourself, but the control
needs to support grab handles, and have a draw state, where it shows
itself in its "not working" mode, and refuses input. In other words,
clicking on any part of it should just trigger "drag", not what ever the
control would normally do when clicked, and it shouldn't, if a display,
react to data coming into it, such as setting its text, etc. Windows,
and certain other standard containers, contain the internal capabilities
of triggering a "go into design mode" message to all of their children.
The problem is, the only application that "supports" this function seems
to be the compiler suite, and there is no clear documentation of how to
use it in your own applications.
There is also an implication, both from how the compiler GUI works, and
the documentation, which implies that any such container, which works as
part of the GUI, can have this setting flipped, and trigger the event,
without making the entire application do it. This is why you can move
around objects in the design GUI, while the GUI itself is still
"functional", including windows, which are themselves elements that can
be placed in other containers, such as the compiler's GUI window. You
still have to implement code to show the "default" state of your
control, and display grab handles, when in that mode, but, in principle,
existing controls, like those that come with the compiler, already have
both. The trick then is, making your container "fire" the event, by
changing its state. Sadly, its not like any of the other states in the
object. You can't set if using the normal methods. Its a **hidden**
function, as is the function to show the handles, or disable the
control, separately. It would have been a **lot** easier if they had
made it an addressable option.
Oh, and just to make things even more fun, some standard controls have
two modes, like the text box "single" vs. "multi-line", which can only
be "set" while the control is in 'design' mode. This means that, if you
wanted to implement a means to add such a control to your own
application, even as something like an element read from an XML markup,
you have to implement *both* the single and multi-line versions in your
application, so that you can instance the correct one, instead of the
**sane** thing, which would be to instance just TextBox, then set it, as
needed, to the single/multiline version you need.
Mind, a lot of this got easier with .NET, and much of it is now
meaningless, but I spent almost a year pulling my hair out a while back,
when the thing I wanted to use it in was likely to be running in Win98
as well as XP.
--
void main () {
If Schrödingers_cat is alive or version > 98 {
if version = "Vista" {
call slow_by_half();
call DRM_everything();
}
call functional_code();
}
else
call crash_windows();
}
<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models,
3D Content, and 3D Software at DAZ3D!</A>
Post a reply to this message
|
 |