Is RichEditBox in WinUI3 support ScrollView_Changeing event? - richeditbox

The RichEditBox controll in WinUI3 has scrollbar, but I don't know how to handle the scrollbar's changing event, and how to set position of the scrollbar.
In the visual tree I can see that RichEditBox contains a scrollviewer, can I get the scrollviewer and set its event handler?

Add a ScrollViewer to wrap the RichEditBox, deal with the ScrollViewer's event, I can get the scroll offset of RichEditBox. That match my question.
But, there's a nother question, how can I do the same thing for webview2? It dosn't work for webview2.

Related

Call IgonrePointer on parent but not child

I am developing my first Flutter app and have a question that I'm not finding an answer to:
I have a static fixed area at the bottom of my screen. Various buttons will be shown here depending on the page. I am using a stack to place this area on top of the rest of the screen, with the page content scrolling underneath my buttons.
The problem I am having is that the button(s) is/are sitting inside of a DecoratedBox, which in turn is sitting in front of my page content. This means that this box is blocking me from clicking on anything below the fixed area (like the button labelled "Programs" in the image)
I have come across the IgnorePointer and AbsorbPointer classes, which allows me to set the decorated box to ignore events. The problem here, however, is that it also causes the buttons in this fixed area to no longer react to events, as they are of course children of the box that I am applying the Igonre/AbsorbPointer classes to.
Is there a way to make the parent decorated box ignore events but have it's children react to them normally?
(blue area must ignore events, and the button must react to events)
Any advice would be greatly appreciated
I think this link should help you solve your problem. I haven't tried it.
Flutter: How to make a ListView transparent to pointer events (but not its non-transparent contents)?

TinyMCE 4.x resize event

I've been searching around (both on SO and around the web) to try to figure out how I can get the current height of the editor after the user has resized it. The TinyMCE 4.x docs don't show any kind of resizing event. When searching around I did come across the ResizeEditor event but that seems to apply only when objects within the editor are resized (which makes it seem like a poorly named event). Despite that, I tried to listen to the ResizeEditor event just to see and it does appear to fire whenever I resize the editor (though, I'm unsure if that's because the actual editor is resizing or because elements within the editor are getting resized, too. In any case, only the event object is passed in as an argument to the listener and I don't see any way to get the editor's current height (after the resize) from that event.
So, is there a way I can do this? To listen to the editor being resized and get its height?
thnx,
Christoph
You should be able to get the entire height of the editor (Menus, Toolbars, StatusBar, content area, etc) with code like this:
tinyMCE.activeEditor.getContainer().clientHeight
tinyMCE.activeEditor.getContainer().clientWidth
When you call tinyMCE.activeEditor.getContainer() you are getting the outermost div that contains all that makes up TinyMCE. From there it is just standard JavaScript to get the relevant dimensions of that element.
Here is an example: http://fiddle.tinymce.com/qigaab/18

Workaround for making Gtk.Label a drag source?

I'm new to Gtk DnD, and I'm trying to make a Gtk.Label a drag source.
It seems it is not directly possible according to pygobject creating a drag and drop source
The workaround seems to be a surrounding invisible event box GtkEventBox (thanks #jku)
But the doc says:
"There is one unexpected issue for an invisible event box that has its window below the child. Since the input-only window is not an ancestor window of any windows that descendent widgets of the event box create, events on these windows aren’t propagated up by the windowing system, but only by GTK+. The practical effect of this is if an event isn’t in the event mask for the descendant window (see gtk_widget_add_events()), it won’t be received by the event box."
So, can I have a invisible GtkEventBox above my Label ?
If the GtkEventBox is below, does the GtkLabel catch events and bubble them up ?
Answer for me :
Surrounding the GtkLabel with a GtkEventBox works without any problem.
And the surrounded GtkLabel still receives the DnD drop events (with and without "visible-window"=False).
Since it worked, I havent played with set_above_child at all.
GtkEventBox was designed for handling input events for widgets that don't have their own GdkWindow. Put your label inside an eventbox and use the eventbox as the dnd source.
An HBox will not work because it has no GdkWindow either.

iPhone css hover, forces me to add a touch event

How come I need to add a touch event to my element for it to enable hover styles?
Is this normal? Sure feels a bit wonky
This is what I have to add to make :hover work, if I don't no :hover style is setsorry for the coffeescript
#button.$el.on('touchstart', ()->
console.log("touch started")
)
Ok so i took a look at what Roddy of the Frozen Peas linked and found that you could add 'ontouchstart=""' to the element to enable hover styles.
What I realised though, was that it's enough to add it to the super parent, and it will bubble down to all child elements, neat-O!

Gtk treeview problems

I have a simple treeview (like this one - http://www.mono-project.com/GtkSharp_TreeView_Tutorial) filled with 200 items and connected to scrollbar. Everything works, but when I select an item and use arrow keys, selected item can be out of visible area. Is it possible to focus on it or set adjustment of scrollbar, i.e.
void HandleTreeSelectionChanged (object sender, EventArgs e)
{
vadjustment.Value=SELECTED-ITEM.DISTANCE-FROM-TOP-OF-TREEVIEW;
}
And one more question: How to paint a black border to table (this tree.EnableGridLines = TreeViewGridLines.Both; makes just inside grid).
Thanks in advance.
Matej
I agree with Johannes' answer that you seem to be doing something odd, you really should just need to use a GtkScrolledWindow. It should handle keyboard navigation (what you seem to be describing in your comment to Johannes' answer) too, this is not something you should need to be doing manually.
To anyway try to answer your question, you can cause the tree view to scroll to any given cell using gtk_tree_view_scroll_to_cell().
To add scroll bars to a tree view (or text view), you just need to add it to a GtkScrolledWindow; it handles everything automatically. I'm pretty sure it also creates a border in most themes.
Update: Alternatively, you can also "bind" the tree view's scrolling behaviour to an arbitrary scrollbar by setting the scrollbar's adjustment to that of the tree view:
scrollbar = gtk.VScrollbar(treeview.props.vadjustment)
(Oh, that's the PyGTK syntax; in Gtk# it's probably treeview.VAdjustment.)