Event for Markup drawing - events

What is the name of event when we start drawing the markup(circle, arrow, rectangle etc.) on the shape when in edit mode? And can we change the markup type in this event?
Problem is: When we are in edit mode and have selected specific shape and color to draw the markup, and in between if we select any markup, the drawing tool takes up that shape and color for the next markup to be drawn ignoring the markup type and color we selected earlier. Is this the normal behavior. Why does the drawing tool take up the configuration of the last selected markup and overrides the type we define through - new Autodesk.Viewing.Extensions.Markups.Core.EditModeCloud(markupExt);
Thanks!

That's an interesting question. I believe the current behavior of markups is as-designed because one would typically only select a markup if they wanted to move it around, scale it, etc. That's why in the current implementation, selecting a markup automatically enters its edit mode.
At the same time I understand your view where if I already activate a specific edit mode, it seems strange that that edit mode would change after simply selecting another markup.
Let me bring this up with the engineering team, and in the meantime, I'd suggest using the Autodesk.Viewing.Extensions.Markups.Core.EVENT_EDITMODE_CHANGED event to detect a change to the edit mode, and if needed, reset the mode to the one you want.

Related

Oracle Reports-How To Add Field Object To Repeating Frame

I want to add field object to an existing repeating frame.But when I drag the field, new frame is generated.
See Image below.
I want to do is put the field F_PO_NUMBER under R_INVOICE frame.
Doble-click on the Paper Layout node.
Touch R_INVOICE repeating frame on the Object Navigator.
Change Fill colour of R_INVOICE by selecting a different than that already has ( colour palette pointers are located on the left side of the Paper Layout ).
Let's choose gray as fill colour, and then there will appear a great gray box on the Paper Layout.
Just drag F_PO_NUMBER to the inside of that gray box. If some frames or objects slides as you drag F_PO_NUMBER, apply immediately an undo by pressing Ctrl+Z, and play with Flex On/Off or Confine On/Off buttons up to your object is able to be removed into that gray box.
I'd suggest you to
create a backup copy of that RDF file - you might need to restore the report if something goes wrong
go to paper layout editor
turn flex OFF (so that frames wouldn't stretch)
select any field in the R_INVOICE frame (for example, F_INVOICE_NUMBER)
copy/paste it (Ctrl+C / Ctrl+V)
a new item (named F_INVOICE_NUMBER1) will be created slightly right & below from the original item)
move it to a new position
if necessary, switch flex ON (and, possibly, confine ON/OFF), but be very careful because you might spoil current layout, and - if you do that - it might be difficult to revert changes. Undo works only 1 level back
change its name & source so that they are appropriate (i.e. F_PO_NUMBER)
save & run the report. Hopefully, it'll be OK.
P.S. As you already have the R_1 frame (which is useless), I'd suggest you to remove (in paper layout editor) it, as well as current F_PO_NUMBER field (visible on your screenshot).

How to get correct background and control colors in property pages?

I'm trying to handle background color properly in a dynamically generated property sheet in dynamically generated property pages in win32 api using MFC (though I expect my question is general, and not restricted to MFC, but since my code and examples use it, it's germane to my question anyway).
So we have a:
CPropertySheet
containing multiple
CPropertyPage
I generate the contents of any given page dynamically - from file resources using a custom dialog definition language - all irrelevant other than to say - a list of controls and their coordinates is created within a given page, and the page is resized to accommodate them. This logic is working beautifully.
However, what doesn't work is that the controls and background of each page draws using the dialog default color/brush.
I've tried a number of ways to attempt to force it to draw using the white color/brush that a hard-coded property sheet / page would.
There are two important pieces to this:
Page Background
Control (on the page) background
For #1, I've tried:
acquire the background brush from parent window class (it's dialog bkgrd) (same is true if I do this and ask the tab control)
change the property page to use WS_EX_TRANSPARENT (PreCreateWindow is not called by the framework when generating a page viz PropertySheet::AddPage)
For #2, I've tried:
overriding OnWndMsg / WM_CTLCOLORSTATIC to forward that request to (A) the parent (sheet), and (B) to the tab control (which is what wants the white in the first place).
However, anytime I use any of the above "ask for the background / forward the request" up the chain to either the sheet or the tab control - I get the dialog background color, never the white I'd expect.
Using Spy64, I can see that for a fully hardcoded property sheet / page - that the only discernable differences I can see is that the dialog window created in AddPage (or its moral equivalent) has WS_CHILD instead of mine which has WS_POPUP (the rest of the styles appear to be the same, such as WS_VISIBLE|DS_3DLOOK|DS_FIXEDSYS|DS_SETFONT|DS_CONTROL and WS_EX_CONTROLPARENT.
So, other than the WS_CHILD, I see no significant differences from what I'm creating and from another property sheet that works properly from a standard resource (i.e. hard coded).
I'm also flummoxed as to how this works normally anyway - since forwarding things like the ctrlcolor message doesn't respond correctly - and asking for the windows background colors similar doesn't - then how is it in a standard case the background colors of controls and pages comes out as white, and not dialog background?
Any ideas or help would be appreciated - I'm kind of running out of ideas...
When Visual Styles were added in Windows XP they really wanted to show off this new feature so they made the tab background a gradient (really a stretched image) instead of a single color and this caused problems in old applications that did custom drawing with the dialog brush as the background.
Because of this, only applications with a comctl32 v6 manifest got the new look but there was a problem; old propertysheet shell extensions would load in new applications (including Explorer) and things would look wrong.
To work around this they also require you (or your UI framework) to call EnableThemeDialogTexture(.., ETDT_ENABLETAB) to get the correct tab page look.
As if things are not tricky enough, there is a undocumented requirement that you also need a button or a static control on the page!
If you have custom controls they have to call DrawThemeParentBackground when you draw if they are partially transparent.
Turns out my old code had defined an ON_WM_ERASEBKGND handler - and removing that (and all of my above attempts) makes it work.
So simply doing NOTHING is the correct answer. D'oh!!!
I'm leaving my shame here in case someone else trips on this! [Whoops!]
(Still interested if anyone has deeper insight into how this mechanism works under the hood)

How does modifying text highlighting work?

We are all familiar with text highlighting. You hover over any "text" in any application on your Windows OS, your cursor changes into an I-Beam, and you can click and drag across the text to Highlight it. This highlighted text can be copied to the clipboard for later use.
Some applications modify the default highlighting behavior by changing color, opacity, or even shape. Some applications allow for column selection (e.g. Visual Studio "alt-click-drag" creates box like highlighting)
I have scoured the depths of the internet, but I can't seem to find a solid source of information that would explain how one would modify the behavior of text highlighting.
How would I implement column/block text selection, and modifying the appearance of the highlighted text in a compiled application.
Since applications can do this in various custom ways, there is no single solution to change how all of them style text selections.
Many will rely on the current color scheme (using GetSysColor) to determine the highlight colors. So you could modify the scheme and maybe affect the colors used for many applications.
To do this programmatically, you would use SetSysColors to change the COLOR_HIGHLIGHT and COLOR_HIGHLIGHTTEXT values.
Other applications might rely on the current theme (using GetThemeColor). To affect those you'd have to select a different theme that has the colors (and perhaps other styling choices) that you want.
A lot of apps use their own hard-coded color schemes, so you won't be able to programmatically at all.
I'm not sure what you mean with the web application part of your question. A web application is some HTML, JS and CSS that make the browser interact with your system. Any custom selection (coloring) logic that the web application provides, has to be implemented by the browser.
Also you have to realize that "(text) selection" is an rather virtual principle. An application can just render a colored shape (like a blue rectangle) and copy something to the clipboard when it receives a WM_COPY message.
Windows provides in basic substring selection functionality for (rich) edit controls (i.e. start and end position), but for something custom like column selection, custom code is required.
Read more about this in Making a rectangular selection in a RichTextBox with Alt-Left-Mouse sweep?.

How to place a windowless control on top of a windows control?

Say, I have an Image control (which seems to be a window-less control) and I want to make sure that it is on top of a TextBox. No matter what I do, the Image control will not appear on top of the Text box.
Is there a way?
P.S. I know I can use a PictureBox, but it does not support transparency, thus I must have the Image control.
There is no way to place an image control over a normal textbox as they are drawn onto the form itself so will always be below any other windowed components.
If you have VB6 installation media there are drawn (windowless) versions of controls including a TextBox you can use that will (probably) do what you want; http://support.microsoft.com/kb/184687
A custom usercontrol of some kind if probably better .. what is it exactly you want to overlay the textbox with?
The Image Control is considered a graphical control, like shapes, so it is always inferior to text controls. If you really want a transparent image, you can use a Microsoft 2.0 Form instead(only if you have it). Images there can be on top of textboxes, and you can make it transparent by setting the Backstyle to Transparent(0).
Completely different approach to my other answer (hence the seperate Answer), but you can set AutRedraw and ClipControls on your Form to false and it will allow the Image control to render on the same layer as a windowed control. You can get some flakey redrawing in some cases but for a quick solution you could try it.
http://msdn.microsoft.com/en-us/library/aa733621(v=vs.60)
I've created a tranparent overlay control to add a kind of annotation layer on top of a VB6 app. I'll attempt to describe it from memory, and if that doesn't provide enough information then you can post back and I'll try to dig up the code.
First, add a new USerControl to you application. Give it a name like ImageEx, PictureEx, or TransparntImage. There are several properties that you will need to use. Ensure the control is Windowed, so it can sit on top of other windowed controls. Locate the MaskColor property and set it to Cyan (or whatever color you elect to use to indicate a tranparent area. There might be an addition property enable the masking behavior, just browse the properties. Set the control background color to that of the MaskColor. At this point you have an invisible control. In my control I painted on top of the surface for annotations, but you can PaintPicture or maybe even set the image property for a really simple approach.
Of course, to make this a re-usable control, you will want to code in your own properties that allow the MaskColor and image, etc to be set so that you can the drop one of these on any form you want.
Some links:
MaskColor Property
MackPicture Property
1) Remove all your textboxes , labels and ... (But memorize their name and location in the form)
2) Go to (project > components) and mark the (Microsoft Forms 2.0 Object Library) then click ok
3) Now you can see new controls under your default controls in your toolbox...
4) Use its textbox and label controls instead of the default controls
5) Right click on your Image Control then click (Bring To Front)

Visual C# Express 2008 Form Designer AutoScroll

This may not be the kind of question one should ask on StackOverflow, but here's a frustration that I've been trying to find a work-around for.
When using the form designer, suppose the entire form does not fit in the space allotted to the form designer, and I have a control say, down near the bottom of the form.
If I try to re-size that control, or move it using the mouse, the work area will auto-scroll to the top of the work area. This essentially pulls my control to the top of the screen. It isn't possible to scroll with the scroll wheel while "holding" a control, and even ScrollLock does nothing for me.
Is there any way to just turn the auto-scrolling off? That way I can at least work on my form without guessing numbers to type into the properties window.
Can't you just turn off autoscroll for the form?
I think it's off by default.
Form.AutoScroll = False

Resources