|
@@ -1078,10 +1078,10 @@ void la_MultiStringDraw(laUiItem *ui, int h){
|
|
|
int len=strlenU(sl->Buf);
|
|
|
if(UseLine==se->CursorLine){
|
|
|
int Dist=se->CursorBefore==0?0:tnsStringGetWidthU(sl->Buf,se->CursorBefore,ui->Flags&LA_TEXT_MONO);
|
|
|
- tnsUseNoTexture(); int d=se->ViewStartCol*MonoWidth;
|
|
|
+ tnsUseNoTexture(); int d=se->ViewStartCol*MonoWidth; real w2=LA_RH/12;
|
|
|
tnsColor4dv(ui->State==LA_UI_ACTIVE?laAccentColor(LA_BT_TEXT):laThemeColor(bt,LA_BT_TEXT_NORMAL));
|
|
|
- tnsVertex2d(_L+Dist-d, LineU); tnsVertex2d(_L+Dist+3-d, LineU);
|
|
|
- tnsVertex2d(_L+Dist-d, LineU+LA_RH); tnsVertex2d(_L+Dist+3-d, LineU+LA_RH);
|
|
|
+ tnsVertex2d(_L+Dist-w2-d, LineU); tnsVertex2d(_L+Dist+w2-d, LineU);
|
|
|
+ tnsVertex2d(_L+Dist-w2-d, LineU+LA_RH); tnsVertex2d(_L+Dist+w2-d, LineU+LA_RH);
|
|
|
tnsPackAs(GL_QUADS);
|
|
|
}
|
|
|
Line++;
|
|
@@ -1743,6 +1743,7 @@ void la_RegisterUiTypesBasic(){
|
|
|
_LA_UI_STRING->GetMinWidth = la_StringPropGetMinWidth;
|
|
|
km=&_LA_UI_STRING->KeyMapper;
|
|
|
laAssignNewKey(km, 0, "LA_edit_string_copy", LA_KM_SEL_UI_EXTRA, LA_KEY_CTRL, LA_KEY_DOWN, 'c', 0);
|
|
|
+ laAssignNewKey(km, 0, "LA_edit_string_copy", LA_KM_SEL_UI_EXTRA, LA_KEY_CTRL, LA_KEY_DOWN, 'x', "mode=CUT");
|
|
|
laAssignNewKey(km, 0, "LA_system_paste", 0, LA_KEY_CTRL, LA_KEY_DOWN, 'v', 0);
|
|
|
pc=laUiHasExtraProps(_LA_UI_STRING, sizeof(laGeneralUiExtraData), 0);{
|
|
|
laAddOperatorProperty(pc, "copy_selection", "Copy Selection", "Copy selected string into clipboard", "LA_edit_string_copy",0,0);
|
|
@@ -1754,6 +1755,7 @@ void la_RegisterUiTypesBasic(){
|
|
|
_LA_UI_STRING_MULTI->GetMinWidth = la_StringPropGetMinWidth;
|
|
|
km=&_LA_UI_STRING_MULTI->KeyMapper;
|
|
|
laAssignNewKey(km, 0, "LA_edit_string_copy", LA_KM_SEL_UI_EXTRA, LA_KEY_CTRL, LA_KEY_DOWN, 'c', 0);
|
|
|
+ laAssignNewKey(km, 0, "LA_edit_string_copy", LA_KM_SEL_UI_EXTRA, LA_KEY_CTRL, LA_KEY_DOWN, 'x', "mode=CUT");
|
|
|
laAssignNewKey(km, 0, "LA_system_paste", 0, LA_KEY_CTRL, LA_KEY_DOWN, 'v', 0);
|
|
|
pc=laUiHasExtraProps(_LA_UI_STRING_MULTI, sizeof(laGeneralUiExtraData), 0);{
|
|
|
laAddOperatorProperty(pc, "copy_selection", "Copy Selection", "Copy selected string into clipboard", "LA_edit_string_copy",0,0);
|
|
@@ -1857,9 +1859,13 @@ int OPINV_EditStringCopySelection(laOperator *a, laEvent *e){
|
|
|
laGeneralUiExtraData *uit = a->This->EndInstance; if(!uit) return LA_FINISHED;
|
|
|
if(!uit->Edit || !strHasSelection(uit->Edit)) return LA_FINISHED;
|
|
|
|
|
|
+ char* mode=strGetArgumentString(a->ExtraInstructionsP,"mode");
|
|
|
+
|
|
|
char* str=strGetEditString(uit->Edit, 1);
|
|
|
laCopyToClipboard(str); free(str);
|
|
|
|
|
|
+ if(strSame(mode,"CUT")){ strClearSelection(&uit->Edit); }
|
|
|
+
|
|
|
return LA_FINISHED;
|
|
|
}
|
|
|
|
|
@@ -1888,14 +1894,14 @@ int la_ProcessTextEdit(laEvent *e, laStringEdit *se, laUiItem* ui){
|
|
|
case LA_L_MOUSE_DOWN:
|
|
|
case LA_MOUSEMOVE:
|
|
|
if(!ui) return 0;
|
|
|
- MonoWidth=tnsGetMonoFontAdvance(); _L=(*ui->Type->Theme)->LM+ui->L;
|
|
|
+ MonoWidth=tnsGetMonoFontAdvance(); _L=(*ui->Type->Theme)->LM*2+ui->L;
|
|
|
int Count=se->TotalLines; while(Count){ Count/=10; _L+=MonoWidth; }
|
|
|
if(e->Type==LA_L_MOUSE_DOWN){
|
|
|
- strSetCursor(se, (e->y-ui->U)/LA_RH+se->ViewStartLine, (e->x-_L-MonoWidth/2)/MonoWidth); strCancelSelect(se); strLazySelect(se);
|
|
|
+ strSetCursor(se, (e->y-ui->U)/LA_RH+se->ViewStartLine, (real)se->ViewStartCol+((real)e->x-_L)/MonoWidth+0.5); strCancelSelect(se); strLazySelect(se);
|
|
|
se->MouseSelecting=1; se->CursorPreferBefore=se->CursorBefore; return 1;
|
|
|
}else{
|
|
|
if(!se->MouseSelecting) return 0;
|
|
|
- strSetCursor(se, (e->y-ui->U)/LA_RH+se->ViewStartLine, (e->x-_L-MonoWidth/2)/MonoWidth); strEndSelect(se);
|
|
|
+ strSetCursor(se, (e->y-ui->U)/LA_RH+se->ViewStartLine, (real)se->ViewStartCol+((real)e->x-_L)/MonoWidth+0.5); strEndSelect(se);
|
|
|
se->CursorPreferBefore=se->CursorBefore; return 1;
|
|
|
}return 0;
|
|
|
case LA_L_MOUSE_UP:
|