I have create a user snippet for driver code in C++. But when I use that code snippet my line gets highlighted. Even though I have other snippets for class, for loops, etc but problem persist only with cpp snippet.
cpp.code-snippet:
example.png:
Your snippet contains one placeholder ($1). When you insert a snippet, the cursor gets to the position of the first placeholder and all the placeholder code will be grayed out for your convenience. As soon as your cursor leaves this gray area, the area will stop being gray. In general, you can use the tab key, which takes you to the next placeholder, if there is one, and outside the snippet otherwise; if you are inside the placeholder, then you can return to the previous one with the shift + tab combination.
Related
I want autocomplete(for me it's a search bar) component to stay in one line and expand when searching. Sadly, the component adds another line when there is a long chip.
For example:
the image shows that the component added a line
how can I stop the component from adding a new line while maintaining it's behavior while writing in it (when you write in the component it expands to show the entire search)
I tried changing its CSS a max lines prop but it didn't work.
granted I might missed something in the CSS
To summarize the behavior of the bar:
it is a multi select
There are two situations
the user isn't using it.
In that situation the bar should just be one line nothing more
the user clicked on it and editing in the bar
In that situation the bar should expand vertically to and show all the chips
right now It correspond with the situation that I described, but if a chip that is too big it expands to two lines and I want it to stay just one line if it isn't situation 2.
On a given form, we replace one component with another.
The original component is a series of TextFields, and the new form is some informational text and a button. We hide the first one, and show the second one (the UI designer has both Containers within the form).
I tried using scrollRectToVisible with various values but it didn't seem to make any difference with the scrolling.
continueButtonContainer.setHidden(false);
f.forceRevalidate();
Button continueButton =
(Button)StateMachine.GetInstance().findByName("ButtonContinue", f);
f.scrollComponentToVisible(continueButtonContainer);
f.scrollComponentToVisible(continueButton);
I'm expecting the continue button to be near the top of the screen.
If the screen was scrolled before displaying the continue button, the button ends up right at the bottom of the screen (it was below the bottom of the screen before I put in the scrollComponentToVisible line(s).
After the user scrolls the screen, the button goes up to where it needs to be, and stays there.
If the screen is not scrolled, the button appears where it should be.
I know I can probably add some invisible containers underneath the button and force them onto the screen, but I would rather have a slightly more robust solution.
There are a few issues with this. First you are using forceRevalidate which should be used in very rare cases.
Second it seems that you are invoking this on a Form, this is a bit misleading. While it seems that:
f.add(myCmp);
Adds a component to the form it is really a synonym to:
f.getContentPane().add(myCmp);
That's important because you need to invoke the scrollComponentToVisible on the scrollable container which will actually do the work and ideally be the direct parent of said component. I'm assuming it's the content pane in your case but it depends on layout etc.
The last part is letting the layout do its job. If you are invoking this before the form is showing this might not work. Notice that doing it after a call to show is meaningless as the form might take time with transitions. You can use a show listener or override the laidOut callback method to perform things like this.
NVDA sometimes seems to remember the position until where I have read a page. When I re-visit that same page, the cursor is placed at this position.
While this may seem handy sometimes, it can lead to unpredictable behaviour e.g. when in a shopping cart and removing the last item. When the page is reloaded, the focus is stuck somewhere in the footer, because the last item isn't there anymore.
I want to disable this, e.g. I always want to have the cursor placed to the beginning of the page (except when the focus is explicitly placed using JavaScript). But I don't find the option for it.
In JAWS, there's a similar option, but I don't remember how it was called (something like "Skip visited elements" maybe?)
I have created a working demo of the problem here:
http://developer-guide.access4all.ch/en/examples/remember_position_when_revisiting_page_example
After clicking, for example, on a button with no handler (that is no any reation axcept button clicking animation) I have this ugly effect on my eyes:
Blurring of the text on the button goes off in a second (from the first picture to the second and so on to the sharpness), then the text gets sharpness. I have this effect at any combinations of "TextOptions" options in XAML including TextOptions.TextFormattingMode="Display".
If I click on a button which raises, for example, select file dialog window, everything seems well.
How to escape this blur? Have you ever seen this effect?
In addition. This effect appears only with TextSize=11 and Aero is disabled. With TextSize equals any another value all goes well. But 11 is a default value so everybody can see this bug!
I don't know if you've fixed this yet or not, but the solution is to use the flag UseLayoutRounding="True". Throw that on the button style and it will be fixed.
I am working on a defect in my GTK code for displaying context menus. After creating a menu with a number of menu items, I use gtk_menu_popup() to display the menu. This function takes a function pointer of type GtkMenuPositionFunc which lets me position the menu. I don't really do anything here except tell GTK to keep current position but push the menu in if part of the menu is outside the monitor (using the fourth argument to the function). My problem is that when GTK pushes the menu in, the absolute position of the menu items does not change. Hence their scroll position changes resulting in scroll bars in the menu. I want the relative position of the menu items w.r.t the menu to remain fixed. Is there any way I can do that? The GTK documentation does warn about this problem, but does not say anything about how to fix it. There is the link to it for reference:
http://library.gnome.org/devel/gtk/unstable/GtkMenu.html#GtkMenuPositionFunc
EDIT: I would have liked to include some code, but the logic is too scattered for that.
You don't need to provide a positioning function if you just want the default behavior. The default behavior is to keep the current position but make sure the menu fits on the monitor, so you can just pass NULL as the positioning function.
You can also take a look at how the default positioning function is written: http://git.gnome.org/browse/gtk+/tree/gtk/gtkmenu.c, gtk_menu_position() currently at line 4288.
PS. If your logic is too scattered to post a code sample, then you should consider cleaning it up.
I was not able to find any way to readjust the scroll-offset of menu items once the menu is pushed in. So, the workaround I used was to avoid having GTK push the menu in vertically. Hence, the original request was to create the menu at position (x,y) but resulted in length L of the menu going out of the screen, I reposition the menu at (x,y-L) in my position function. Similarly, if y<0 I change set it to (x,0). I still tell GTK to push in any menu that goes outside the screen to take care of menus going over the left and right margins.