ide: Annotations now work even if code reference is in table, Draw: docs

git-svn-id: svn://ultimatepp.org/upp/trunk@12938 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-04-03 13:44:31 +00:00
parent 06e5a25ce1
commit 21bf5dcb1d
3 changed files with 36 additions and 8 deletions

View file

@ -15,11 +15,15 @@ topic "";
[s0; U`+`+ provides a set of colors that are adjusted according to
current settings of host platform. Using these colors makes it
easier to adapt the application to host platform settings.&]
[s0; &]
[s0; Following table shows colors that represent certain hue. When
transformed to dark theme, hue is maintained while brightness
of color changes.&]
[s0;3%- &]
[ {{3044:3508:1778:1670@7 [s0;%- Color]
:: [s0;%- Description]
:: [s0;=%- Win 10 light]
:: [s0;=%- Win 10 dark]
:: [s0;=%- Light theme]
:: [s0;=%- Dark theme]
::@2 [s0;:SBlack`(`):%- Color [* SBlack]()]
:: [s0;%- Possibly theme adjusted color.]
:: [s0;=%-
@ -199,8 +203,16 @@ easier to adapt the application to host platform settings.&]
:: [s0;=%-
@@rawimage:256&96
(iVBORw0KGgoAAAANSUhEUgAAAIAAAAAwCAYAAADZ9HK+AAAACXBIWXMAAAAAAAAAAAHqZRakAAAApElEQVR4nO3coRGAQAwAwcDQIzVSJWgGz4vbdXkVcRP528zcQ9a+egHWEkCcAOKOz8t1LViD35zna3QB4gQQJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAogTQJwA4gQQJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiNvGX8FpLkCcAOIEEPcA038EXwIEgSEAAAAASUVORK5CYII=)
]
:: [s0;:SColorPaper`(`):%- Color [* SColorPaper]()]
]}}&]
[s0; &]
[s0; Following colors provide host platform provided information
about colors of GUI element parts:&]
[s0;%- &]
[ {{3044:3508:1778:1670@7 [s0;%- Color]
:: [s0;%- Description]
:: [s0;=%- Win 10 light]
:: [s0;=%- Win 10 dark]
::@2 [s0;:SColorPaper`(`):%- Color [* SColorPaper]()]
:: [s0;%- Normal background.]
:: [s0;=%-
@@rawimage:256&96

View file

@ -1,5 +1,4 @@
topic "Common Raster classes";
[2 $$0,0#00000000000000000000000000000000:Default]
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
[l288;2 $$2,2#27521748481378242620020725143825:desc]
[0 $$3,0#96390100711032703541132217272105:end]
@ -9,6 +8,7 @@ topic "Common Raster classes";
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
[b42;2 $$9,9#13035079074754324216151401829390:normal]
[2 $$0,0#00000000000000000000000000000000:Default]
[{_}
[ {{10000@(113.42.0) [s0;%% [*@7;4 ImageRaster]]}}&]
[s3; &]
@ -151,4 +151,4 @@ progress of operation or to cancel it by returning true.&]
[s2;%% Puts StreamRaster into error state (error state is reset by
Open).&]
[s3; &]
[s0; ]
[s0; ]]

View file

@ -23,7 +23,7 @@ void AssistEditor::Annotate(const String& filename)
}
}
bool IsCodeItem(RichText& txt, int i)
bool IsCodeItem(const RichTxt& txt, int i)
{
static Uuid codeitem = CodeItemUuid();
static Uuid stritem = StructItemUuid();
@ -93,11 +93,26 @@ void AssistEditor::SyncAnnotationPopup()
String path = GetTopicPath(tl);
if(path != last_path)
topic_text = ParseQTF(ReadTopic(LoadFile(path)).text);
RichText result;
String cr = coderef;
for(int pass = 0; pass < 2; pass++) {
for(int i = 0; i < topic_text.GetPartCount(); i++)
if(topic_text.IsTable(i)) {
const RichTable& t = topic_text.GetTable(i);
Size sz = t.GetSize();
for(int y = 0; y < sz.cy; y++)
for(int x = 0; x < sz.cx; x++) {
const RichTxt& txt = t.Get(y, x);
for(int i = 0; i < txt.GetPartCount(); i++) {
if(txt.IsPara(i) && txt.Get(i, topic_text.GetStyles()).format.label == cr) {
RichTable r(t, 1);
result.CatPick(pick(r));
goto done;
}
}
}
}
else
if(IsCodeItem(topic_text, i) && topic_text.Get(i).format.label == cr) {
while(i > 0 && IsCodeItem(topic_text, i)) i--;
if(!IsCodeItem(topic_text, i)) i++;
@ -118,6 +133,7 @@ void AssistEditor::SyncAnnotationPopup()
if(pass == 0 && !LegacyRef(cr))
break;
}
done:
result.SetStyles(topic_text.GetStyles());
annotation_popup.Pick(pick(result), GetRichTextStdScreenZoom());
}