Skip to content

Commit

Permalink
Added CharacterSet enum for dialogs.
Browse files Browse the repository at this point in the history
  • Loading branch information
lkinsella committed Jul 12, 2016
1 parent 1ffb26c commit f087ecc
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
54 changes: 54 additions & 0 deletions Src/Workshell.PE.Resources/CharacterSet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Workshell.PE.Annotations;

namespace Workshell.PE.Resources
{

public enum CharacterSet : byte
{
[EnumAnnotation("ANSI_CHARSET")]
ANSI = 0,
[EnumAnnotation("DEFAULT_CHARSET")]
Default = 0x01,
[EnumAnnotation("SYMBOL_CHARSET")]
Symbol = 0x02,
[EnumAnnotation("MAC_CHARSET")]
Mac = 0x4D,
[EnumAnnotation("SHIFTJIS_CHARSET")]
ShiftJis = 0x80,
[EnumAnnotation("HANGUL_CHARSET")]
Hangul = 0x81,
[EnumAnnotation("JOHAB_CHARSET")]
Johab = 0x82,
[EnumAnnotation("GB2312_CHARSET")]
GB2312 = 0x86,
[EnumAnnotation("CHINESEBIG5_CHARSET")]
ChineseBig5 = 0x88,
[EnumAnnotation("GREEK_CHARSET")]
Greek = 0xA1,
[EnumAnnotation("TURKISH_CHARSET")]
Turkish = 0xA2,
[EnumAnnotation("VIETNAMESE_CHARSET")]
Vietnamese = 0xA3,
[EnumAnnotation("HEBREW_CHARSET")]
Hebrew = 0xB1,
[EnumAnnotation("ARABIC_CHARSET")]
Arabic = 0xB2,
[EnumAnnotation("BALTIC_CHARSET")]
Baltic = 0xBA,
[EnumAnnotation("RUSSIAN_CHARSET")]
Russian = 0xCC,
[EnumAnnotation("THAI_CHARSET")]
Thai = 0xDE,
[EnumAnnotation("EASTEUROPE_CHARSET")]
EastEurope = 0xEE,
[EnumAnnotation("OEM_CHARSET")]
OEM = 0xFF
}

}
13 changes: 12 additions & 1 deletion Src/Workshell.PE.Resources/Dialogs/DialogEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ public sealed class DialogEx : IEnumerable<DialogItemEx>
private ResourceId cls;
private string title;
private Font font;
private CharacterSet char_set;
private DialogItemEx[] items;

internal DialogEx(Stream stream)
Expand Down Expand Up @@ -296,7 +297,9 @@ internal DialogEx(Stream stream)
ushort point_size = Utils.ReadUInt16(stream);
ushort weight = Utils.ReadUInt16(stream);
byte italic = Utils.ReadByte(stream);
byte charset = Utils.ReadByte(stream);

char_set = (CharacterSet)Utils.ReadByte(stream);

string type_face = Utils.ReadUnicodeString(stream);

font = new Font(type_face, point_size);
Expand Down Expand Up @@ -428,6 +431,14 @@ public Font Font
}
}

public CharacterSet CharSet
{
get
{
return char_set;
}
}

public int ItemCount
{
get
Expand Down
1 change: 1 addition & 0 deletions Src/Workshell.PE.Resources/Workshell.PE.Resources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CharacterSet.cs" />
<Compile Include="Dialogs\Dialog.cs" />
<Compile Include="Dialogs\DialogEx.cs" />
<Compile Include="Dialogs\DialogResource.cs" />
Expand Down

0 comments on commit f087ecc

Please sign in to comment.