how to achieve the automaticaly number list function? - android-edittext

I want to achieve a easy funnction just similar to many editbox's function. as below:
one
two.
This is so easy. The question is the cursor. When I tried to overwrite onKeyListenner, use EditText.append(). the number was correctly added. But the cursor will appear at next line. If I use setSelection to change the position. It would be turn to before the point.
like this:
1.fisrt line.
2(cursor's place).
Does anyone can help?
if(event.getAction()==KeyEvent.ACTION_DOWN&&keycode==KeyCode_ENTER) {
edittext.append("\n"+number+++".");
}
It's show like this:
Fisrt
(cursor's position)

I have found the solution:
Overwrite the onEditTextChangedListener
when event.getKeycode==Keyevent.enter
return true.
then it will be ok.

Related

Extjs 6 Ext.grid.plugin.RowEditing Remove Update / Cancel buttons

I am trying to remove update cancel buttons.
but no any config's are available for this.
I have tried to override but i cant remove this.
please if you have done task like this or know how to do this help me.
You're absolutely right that there is no built-in way to hide the update and cancel buttons with the row editing plugin.
You could try to hide the button bar via CSS. The normal CSS class name is x-grid-row-editor-buttons. But this may cause other problems.
Or, you could try a different editor, such as the CellEditing plugin - this lets you edit one cell at a time, as opposed to showing the editors for the entire row, and doesn't use buttons.
You might be able to remove the button by overriding the Ext.grid.plugin.RowEditing. A quick look at the source shows me an array with in the initEditiorFunction() which looks like this.
btns = ['saveBtnText', 'cancelBtnText', 'errorsText', 'dirtyText'],
Try removing the cancelBtnText button, and perhaps it won't show on there? I haven't tested this but this might be something in the right direction.

Write text in OpenLayers3

I need to write some text in openLayers 3... Not a label, something like a text object, that I can select and drag around the map. This text must have multiple lines.
I tried to use a point with ol.style.text, but it isn't multiline.
I also tried the popups, but I need the text to be always displayed.
Is there any way to use a text feature for this (ol.format.TextFeature)?
Is there any object that I can use for that purpose?
Thanks!!
You can use an ol.Overlay for that. An overlay is basically anything an Element can be. It has a position an positioning that can be set at any time.
See an example: http://openlayers.org/en/v3.9.0/examples/overlay.html?q=overlay
You could use map browser events (pointerdown, pointerup) and if the target is your overlay element then you could move it around and update its position.

C++Builder 5 Set TDBChart Series Visible

Does anyone know how you can configure the visibility of a TeeChart Series programmatically in C++? I can't seem to find the right proprety using the auto completion.
I basically want to set Series1 visible at certain times and Series2 invisible, and the other way round following different conditions.
What I basically want is something to this effect :
Series1->Visible = false;
Series2->Visible = true;
except that this doesn't work.
If anyone could help, that would be greatly appreciated.
Chris
Found the answer to my own question. The property is "Active" - don't know why I didn't think of it before.
C++ :
Series1->Active = False;
Series2->Active = True;
EDIT : Beware, even if you change the title of your series, the "real" name to use in this code will probably still be Series1/2/... . This is because every Series you create (by right clicking on the TDBChart->Chart->Series->Add) creates a TBarSerie which seemingly can only be accessed from the Object inspector. The title you give it doesn't affect its real name.
Thanks for your comment, Narcis Calvet.

First node stays on top

I want the first node to stay on top and should not be affected during scroll. The first node will be like a column header(stays on top even scrolling). How can I do that?
This kind of behavior is something you can currently find in spreasheets:
Lock first column (Header.Columns[0].Options → coFixed)
Lock first row (?)
I'm trying to insert a picture for more explanation but I don't have 10 reputations. Sorry about that. Thanks in advance.
You can't as VirtualTree doesn't support such a behaviour. Besides, VT already has header support (include hoVisible to Header.Options to show it) why don't you use that? You can custom paint it (see OnHeaderDraw events) if you want it to look like ordinary node.

How to use TVirtualStringTree to display multi-line items and "expanded" select item?

I'm looking to create a look similar to the image below (which I know was done using TVirtualStringTree), but I haven't found any example code on how to accomplish this.
Anyone knows how I can have multi-line items like on the example below, and "expand" the select item to show more lines?
Please take a look at VT Demos\Advenced. In there you have a Multiline nodes demo which I guess might be the thing you are looking for.
Demos can be found here
Edit: The download page is here and the third item is the demos.
I guess you've got an answer, but I'll give you a couple hints for putting this into practice because it's been a little wonky for me. (At least in Delphi 7)
If you do a #13#10 for a new line make sure you've got a space after the the #10, otherwise you will not get a line break.
VirtualTree.MultiLine[node] := true will allow multi line, but not necessarily make it multiline.
Do VirtualTree.InvalidateNode(Node) then VirtualTree.Refresh the tree to get the new size for the node after you've changed the caption.

Resources