Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb434c83

Browse files
committed
#101 working on a little visual bug on tooltip
1 parent81520d8 commitb434c83

File tree

5 files changed

+61
-25
lines changed

5 files changed

+61
-25
lines changed

‎Sources/WPFHexaEditor/Core/Bytes/Byte_16bit.cs‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//////////////////////////////////////////////
2-
// Apache 2.0 - 2020
2+
// Apache 2.0 - 2020-2021
33
// Base author : ehsan69h
4+
// Modified by : Abbaye
45
//////////////////////////////////////////////
56

67
usingSystem;
@@ -29,9 +30,13 @@ public List<byte> OriginByte
2930
}
3031
publicD_ByteListPropdel_ByteOnChange{get;set;}
3132

33+
publicstringText{get;internalset;}
34+
35+
publiclongLongText{get;internalset;}
36+
3237
publicstringGetText(DataVisualTypetype,DataVisualStatestate,ByteOrderTypeorder)
3338
{
34-
stringText="";
39+
stringtext="";
3540
byte[]value=newbyte[2];
3641
boolsign_positive=true;
3742
stringprefix="";
@@ -74,27 +79,31 @@ public string GetText(DataVisualType type, DataVisualState state, ByteOrderType
7479
}
7580

7681
if(state==DataVisualState.ChangesPercent)
77-
Text=(sign_positive?"":"-")+prefix+BitConverter.ToUInt16(value,0).ToString("d2");
82+
text=(sign_positive?"":"-")+prefix+BitConverter.ToUInt16(value,0).ToString("d2");
7883
else
7984
{
8085
switch(type)
8186
{
8287
caseDataVisualType.Hexadecimal:
8388
varchArr=ByteConverters.ByteToHexCharArray(value[0]).Concat(ByteConverters.ByteToHexCharArray(value[1])).ToArray();
84-
Text=(sign_positive?"":"-")+prefix+newstring(chArr);
89+
text=(sign_positive?"":"-")+prefix+newstring(chArr);
8590
break;
8691
caseDataVisualType.Decimal:
87-
Text=(sign_positive?"":"-")+prefix+
92+
text=(sign_positive?"":"-")+prefix+
8893
BitConverter.ToUInt16(value:value.Reverse().ToArray(),startIndex:0).ToString("d5");
8994
break;
9095
caseDataVisualType.Binary:
91-
Text=(sign_positive?"":"-")+prefix+
96+
text=(sign_positive?"":"-")+prefix+
9297
Convert.ToString(value[0],2).PadLeft(8,'0')+
9398
Convert.ToString(value[1],2).PadLeft(8,'0');
9499
break;
95100
}
96101
}
97-
returnText;
102+
103+
LongText=ByteConverters.HexLiteralToLong(text).position;
104+
Text=text;
105+
106+
returntext;
98107
}
99108

100109

‎Sources/WPFHexaEditor/Core/Bytes/Byte_32bit.cs‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//////////////////////////////////////////////
2-
// Apache 2.0 - 2020
2+
// Apache 2.0 - 2020-2021
33
// Base author : ehsan69h
4+
// Modified by : Abbaye
45
//////////////////////////////////////////////
56

67
usingSystem;
@@ -30,9 +31,13 @@ public List<byte> OriginByte
3031
}
3132
publicD_ByteListPropdel_ByteOnChange{get;set;}
3233

34+
publicstringText{get;internalset;}
35+
36+
publiclongLongText{get;internalset;}
37+
3338
publicstringGetText(DataVisualTypetype,DataVisualStatestate,ByteOrderTypeorder)
3439
{
35-
stringText="";
40+
stringtext="";
3641
byte[]value=newbyte[4];
3742
boolsign_positive=true;
3843
stringprefix="";
@@ -80,7 +85,7 @@ public string GetText(DataVisualType type, DataVisualState state, ByteOrderType
8085
}
8186

8287
if(state==DataVisualState.ChangesPercent)
83-
Text=(sign_positive?"":"-")+prefix+BitConverter.ToUInt16(value,0).ToString("d2");
88+
text=(sign_positive?"":"-")+prefix+BitConverter.ToUInt16(value,0).ToString("d2");
8489
else
8590
switch(type)
8691
{
@@ -90,23 +95,26 @@ public string GetText(DataVisualType type, DataVisualState state, ByteOrderType
9095
ByteConverters.ByteToHexCharArray(value[1]).Concat(
9196
ByteConverters.ByteToHexCharArray(value[2]).Concat(
9297
ByteConverters.ByteToHexCharArray(value[3])))).ToArray();
93-
Text=(sign_positive?"":"-")+prefix+
98+
text=(sign_positive?"":"-")+prefix+
9499
newstring(chArr);
95100
break;
96101
caseDataVisualType.Decimal:
97-
Text=(sign_positive?"":"-")+prefix+
102+
text=(sign_positive?"":"-")+prefix+
98103
BitConverter.ToUInt32(value.Reverse().ToArray(),0).ToString("d10");
99104
break;
100105
caseDataVisualType.Binary:
101-
Text=(sign_positive?"":"-")+prefix+
106+
text=(sign_positive?"":"-")+prefix+
102107
Convert.ToString(value[0],2).PadLeft(8,'0')
103108
+Convert.ToString(value[1],2).PadLeft(8,'0')
104109
+Convert.ToString(value[2],2).PadLeft(8,'0')
105110
+Convert.ToString(value[3],2).PadLeft(8,'0');
106111
break;
107112
}
108113

109-
returnText;
114+
LongText=ByteConverters.HexLiteralToLong(text).position;
115+
Text=text;
116+
117+
returntext;
110118
}
111119

112120

‎Sources/WPFHexaEditor/Core/Bytes/Byte_8bit.cs‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//////////////////////////////////////////////
2-
// Apache 2.0 - 2020
2+
// Apache 2.0 - 2020-2021
33
// Base author : ehsan69h
4+
// Modified by : Abbaye
45
//////////////////////////////////////////////
56

67
usingSystem;
@@ -30,9 +31,13 @@ public List<byte> OriginByte
3031

3132
publicD_ByteListPropdel_ByteOnChange{get;set;}
3233

34+
publicstringText{get;internalset;}
35+
36+
publiclongLongText{get;internalset;}
37+
3338
publicstringGetText(DataVisualTypetype,DataVisualStatestate,ByteOrderTypeorder)
3439
{
35-
stringText="";
40+
stringtext="";
3641
bytevalue;
3742
boolsign_positive=true;
3843
stringprefix="";
@@ -71,26 +76,29 @@ public string GetText(DataVisualType type, DataVisualState state, ByteOrderType
7176
}
7277

7378
if(state==DataVisualState.ChangesPercent)
74-
Text=(sign_positive?"":"-")+prefix+value.ToString("d2");
79+
text=(sign_positive?"":"-")+prefix+value.ToString("d2");
7580
else
7681
switch(type)
7782
{
7883
caseDataVisualType.Hexadecimal:
7984
varchArr=ByteConverters.ByteToHexCharArray(value);
80-
Text=(sign_positive?"":"-")+prefix+
85+
text=(sign_positive?"":"-")+prefix+
8186
newstring(chArr);
8287
break;
8388
caseDataVisualType.Decimal:
84-
Text=(sign_positive?"":"-")+prefix+
89+
text=(sign_positive?"":"-")+prefix+
8590
value.ToString("d3");
8691
break;
8792
caseDataVisualType.Binary:
88-
Text=(sign_positive?"":"-")+prefix+
93+
text=(sign_positive?"":"-")+prefix+
8994
Convert.ToString(value,2).PadLeft(8,'0');
9095
break;
9196
}
9297

93-
returnText;
98+
LongText=value;
99+
Text=text;
100+
101+
returntext;
94102
}
95103

96104
publicboolIsEqual(byte[]bytes)

‎Sources/WPFHexaEditor/Core/Interfaces/IByte.cs‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//////////////////////////////////////////////
2-
// Apache 2.0 - 2020
2+
// Apache 2.0 - 2020-2021
33
// Base author : ehsan69h
4+
// Modified by : Abbaye
45
//////////////////////////////////////////////
56

67
usingSystem.Collections.Generic;
@@ -25,5 +26,15 @@ interface IByte
2526

2627
publicvoidChangeByteValue(bytenewValue,longposition);
2728

29+
/// <summary>
30+
/// GetText() need to be called before
31+
/// </summary>
32+
publicstringText{get;}
33+
34+
/// <summary>
35+
/// GetText() need to be called before
36+
/// </summary>
37+
publiclongLongText{get;}
38+
2839
}
2940
}

‎Sources/WPFHexaEditor/Resources/Dictionary/ToolTipDictionary.xaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
Apache 2.0 - 2016-2018
2+
Apache 2.0 - 2016-2021
33
Author : Derek Tremblay (derektremblay666@gmail.com)
44
-->
55

@@ -27,9 +27,9 @@
2727
Width="50"
2828
Content="{x:Static p:Resources.ByteString}"
2929
FontWeight="Bold" />
30-
<LabelWidth="70"Content="{Binding Byte, UpdateSourceTrigger=PropertyChanged}" />
30+
<LabelWidth="70"Content="{Binding Byte.LongText, UpdateSourceTrigger=PropertyChanged}" />
3131
<LabelContent="{x:Static p:Resources.HexString}"FontWeight="Bold" />
32-
<LabelContent="{Binding Byte, Converter={StaticResource LongHexConverter}, UpdateSourceTrigger=PropertyChanged}" />
32+
<LabelContent="{Binding Byte.LongText, Converter={StaticResource LongHexConverter}, UpdateSourceTrigger=PropertyChanged}" />
3333
</StackPanel>
3434
<StackPanelOrientation="Horizontal">
3535
<Label

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp