How to delete cell from sage notebook? - sage

How to delete cell from sage notebook?
Any click is just creating something, no way to delete:

If you are using the legacy Sage notebook, you delete a cell by removing all content and then doing backspace/delete. To quote this tutorial,
If for some reason you need to remove or delete an input cell, just delete all the text inside of it, and then press backspace in the now-empty cell.

Related

Markdown cells disappear when I double click

I recently started using Jupyter notebooks, and sometimes when I double click on a cell the text will disappear.
Sometimes by double clicking the cell directly above I can get the cell to reappear, sometimes I cannot. I haven't been able to deduce the actual commands and what's going on. Does anyone know what I'm dealing with?

Shortcut key for changing code cell to markdown cell in jupyter notebook

Kind of silly, but is there a shortcut key to change a code cell to markdown cell?
To place a markdown cell, I have to insert a cell, then go to the toolbar menu (below the main menu bar), and then select "Markdown" instead of "Code".
Press M whilst in command mode (highlight around the selected cell should be blue, not green), use Esc to switch to command mode and Enter to switch back to edit mode.
So, if you're editing a cell, the key presses to change the cell to a markdown cell are Esc, M, Enter.
You can look up all the Jupyter notebook keyboard commands by pressing the keyboard icon in the toolbar. You can also edit your keyboard shortcuts by going to Help > Edit Keyboard Shortcuts
check help on the menu, there is keyboard shortcuts
select the code cell, press "esc + m ",and it will be a markdown cell.
moreover, from markdown cell to code cell, press " esc + y ".
Navigate to the required cell and press the Esc key on your keyboard followed by the M key
If you're using vim-bindings, the shortcut changes to Ctrl+2, also in command mode as in #Louise Davies answer.

QListView and QAbstractListModel: how to manually set an item under editing, with cursor flashing?

I have a QAbstractListModel and QListView (for example, a list of input ports of an electronic device).
I've just added a row into the model, gave it a temp name (something like "RENAME_ME_PLZ_ASAP"). I want user to rename it, and I want to set the editing focus to this cell to make it possible to start typing the new port name without aiming the mouse to the cell added and double-clicking on it.
The editing of the item should begin, and its temp text contents should be selected (to be deleted by user when the typing will start).
How can it be done?
As you said you should should be able to edit, without aiming the mouse to the cell added and double-clicking on it.
Probably you can use QAbstractItemView::CurrentChanged edit trigger.
QListView *pListView = new QListView(<<Your parent widget>>); //rough
pListView->setEditTriggers(QAbstractItemView::CurrentChanged);
You have many edit triggers in below link, but I guess the above one suits you best.
http://doc.qt.io/qt-5/qabstractitemview.html#EditTrigger-enum
And if you are on embedded LINUX you can also use.
pListView->setEditFocus(true);
Well, I've just called QAbstractItemModel::edit(...) method.
^__^

How to unselect selected text in jupyter or how to make click & drag always select?

When I select a code in a Jupyter notebook cell, the code stays selected as long as I don't click into a different part of the same cell that is not selected. So, for example, if I select more text than I wanted, I have to click outside of the selection first, before being able to re-select the portion you want. This is very annoying, particularly if I select all the text within a cell and then want to select a smaller portion of text. I need to scroll up or down to the edge of the selection and click exactly before or after the selected text to unselect it again. Is there a way to make the jupyter notebook behave in a way that every click and drag creates a new selection rather than moving already selected text?
If I understood correctly, you want a way to reduce the size of the selected text area. You can do this holding shift-clicking within the selected text box, this will move the end-marker to the point where you clicked.
Unfortunately this only works with the end-marker and not the start-marker as is standard. I have raised a ticket with codemirror (the project that jupyter-notebook uses for the text editor).

DevExpress GridControl cells' inner text selectable but not editable

GridControl is working like~ Excel natively:
Clicking once on the cell selects it. Copy copies the cell value and the header.
Clicking twice on the cell selects the inner text. Copy copies only the inner text.
I am working on preventing the cell edition hooking the ShowingEditor event, setting the edition to e.Cancel.
However this prevents the behaviour 2. above. I'd like to still be able to select the inner text for copy, just that I'd like it to be not editable.
Would you know how to do this? Fyi, this behavior can be achieved at a column level by setting the ReadOnly to true:
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="field" ReadOnly="True"/>
EDIT
My grid is setup like this:
<dxg:GridControl>
<dxg:GridControl.Resources>
</dxg:GridControl.Resources>
<dxg:GridControl.View>
<dxg:GridControl.TableView>
</dxg:GridControl.TableView>
</dxg:GridControl.View>
<dxg:GridControl.Columns>
</dxg:GridControl.Columns>
</dxg:GridControl>
Thank you!
Have you tried
GridView.OptionsBehavior.CopyToClipboardWithColumnHeaders = False
Also you could try this approach suggested by DevExpress
Copy single cell content to clipboard from XtraGrid when user presses Ctrl+C

Resources