QUAN | 5 Aug 2008 13:24
Picon

Re: characters/struct/enum/examples in the Dao

Hi Sam,

For the UTF-8 question...

It seems that you are using Windows, then...

First, if you could check the
[ControlPanel->RegionalAndLanguageOptions->Language->TextServiceAndInputLanguages->Detail->Advanced],
then make sure that options in the [CompatibilityConfiguration] is
checked, and the [SystemConfiguration->TurnOffAdvancedTextServices] is
unchecked.

Then, go to [ControlPanel->Display->Appearance->Advanced], and make
sure all window texts are using a font that support UTF-8.

It could happen that the system wants you to put back in your
installation CD if you are using one of the European language versions
of Windows.

Try Ubuntu pal. If I can also suggest.

Regards
Quan

2008/8/5 Sam Hu <SamHu.SamHu <at> gmail.com>:
>
> Hi both,
>
> Appreciate again.
>
(Continue reading)

Sam Hu | 5 Aug 2008 14:15
Picon

Re: characters/struct/enum/examples in the Dao


Hi QUAN,

Thanks.

For Chinese font,I tried what you said but still failed ,I am
confident have done everything you've said;

For Linux,I have Fedoa Core 5 on hand for a very long time and once
installed and played for a while,but finally get back to Windows for 2
reasons:
1.for work purpose to maximum compatible to company environment,but
this is not the main reason;
2.Could anybody give me a reason the Linux is better ?I could not find
it ,maybe becoz I just tried for a while.

Regards,
Sam

On Aug 5, 7:24 pm, QUAN <longquan1...@...> wrote:
> Hi Sam,
>
> For the UTF-8 question...
>
> It seems that you are using Windows, then...
>
> First, if you could check the
> [ControlPanel->RegionalAndLanguageOptions->Language->TextServiceAndInputLan-guages-≥Detail->Advanced],
> then make sure that options in the [CompatibilityConfiguration] is
> checked, and the [SystemConfiguration->TurnOffAdvancedTextServices] is
(Continue reading)

Jerome St-Louis | 5 Aug 2008 18:00
Picon

Re: characters/struct/enum/examples in the Dao

Hi Sam,

The truth is that Windows console simply doesn't support UTF-8, as I found out recently trying to set it up myself...
There was a hack which apparently worked at one point, setting the codepage to a particular ID which represents UTF-8.

See the following:

http://www.google.ca/search?hl=en&safe=off&q=SetConsoleOutputCP+utf-8&btnG=Search&meta=

http://blogs.msdn.com/michkap/archive/2007/05/11/2547703.aspx

http://www.tek-tips.com/viewthread.cfm?qid=1428936&page=2

http://msdn.microsoft.com/en-us/library/ms686036(VS.85).aspx

SetConsoleOutputCP( 65001 ) // that is supposed to set the console to UTF-8

However that command fails for me.

Please let me know if you do manage to make it work :)


Why is Linux better? This particular thing is just one example...
The fact that Linux is open and free is a big plus also.

Operator Overloading:

I'm hoping to support it in a future version of eC. However at the moment much can be done with the "conversion properties" of eC for scalar types, which would normally require operator overloading if they were C++ classes. Related units can be added, subtracted together.

For support in Vectors per example, I will have to add extra support to specify how vectors are to be operated upon...
Here's some sample code:


void Main()
{
   ColorRGB a = Color { 255, 0, 0 };
   Color c = ColorRGB { 0.35f, 1.0f, 1.0f };
   ColorRGB a = Red;
   ColorHSV a = ColorHSV { Degrees{90}, 100, 100 };
   ColorHSV a = ColorHSV { 90, 100, 100 };
   ColorRGB a = ColorHSV { 90, 100, 100 };
   ColorRGB a = ColorHSV { Degrees { 90 }, 100, 100 };
   Color a = ColorHSV { 100, 40, 30 };
   Color a = ColorHSV { 0, 50, 100 };
   Color a = ColorRGB { 1, 0.3f, 0.3f };
   Color c = ColorRGB { 0.35f, 1.0f, 1.0f };
   ColorRGB a = Red;
   ColorRGB a = ColorHSV { 1, 0.3f, 0.3f };
   ColorCMYK a = ColorHSV { 90, 60, 40 };
   ColorLab a = Red;
   ColorHSV a = ColorHSV { Pi/8, 100, 100 };
   ColorHSV a = ColorRGB { 1, 0.3f, 0.3f };
   ColorHSV a = Color { 40, 130, 30 };  
   ColorHSV a = ColorRGB { 40/255.0f, 130/255.0f, 30/255.0f };  
   ColorHSV a = Red;
   ColorHSV a = Indigo;
   ColorHSV a = ColorLab { 30, 60, -40 };
   ColorHSV a = ColorRGB { 1, 0.3f, 0.3f };
   ColorHSV a = Color { 40, 130, 30 };
   ColorHSV a = ColorLab { 40, 60, 30 };
   ColorHSV a = Red;
   Color a = ColorHSV { a, 40, 30 };
   double a = 4 + Pi;
   double a = Pi + 4;
   double a = 4 + Pi + 0;
   double a = Pi + 4 + 0;
   double a = 0 + 4 + Pi;
   double a = 0 + Pi + 4;
   double a = Radians{0} + Pi;
   double a = Degrees{0} + Degrees{30};
   Degrees a = Radians{Pi/4} + 45;
   Degrees a = Radians{Pi/4} + 20 + Degrees{30};  
   Degrees a = Radians{Pi/4} + Pi/8 + Degrees{30} + Pi/4;
   Degrees a = Radians{0} + Pi;
   Degrees a {Radians{Pi/2}};
   double a = Radians{Pi/4} + Degrees{30};    // Make this a warning...
   double a = Degrees{30} + Radians{Pi/4};    // Make this a warning...
   double a = (Degrees)Radians{Pi};
   Degrees a = Radians{Pi/2};
   Degrees a = Radians{Pi/4};
   double a = (Radians)Degrees{45};  
   double a = Degrees{30} / 4;
   double a = Degrees{30} + Pi/4;      // This should generate a warning...
   double a = Degrees{30} + Pi/8 ;     // This should generate a warning...
   double a = Radians{Pi/4} + Pi/8 + Degrees{30} + Pi/4; // This should generate a warning...
   Radians a = Degrees{30};

   Radians a = (Radians)Degrees{45} * 4;
   Radians a = Degrees{45} * 4;
   Radians a = Degrees{20} + 25;

   Degrees a = Degrees{Radians{10}};

   Degrees a = Degrees{60};
   Radians a = Degrees{Radians { Pi/2 }};

   Radians a = Degrees{Pi/2};
   double a = (Degrees) (Pi/4);
   Degrees a;
   Radians b = a;

   double a = (Degrees)Radians{Pi};
   Degrees a = Pi/4;
   double a;
   double e = Degrees{60};
   double e = Degrees{a};

   double dbl;
   Degrees deg;

   Degrees a = Degrees { dbl };
   Degrees a = Degrees { deg };
   Degrees a = Degrees { Degrees { dbl } };
   Degrees a = Degrees { a };

   Degrees a = Degrees { Degrees { 30 } };
   Degrees a = Degrees { 60 };
   Degrees c = Radians{1.40};
   Degrees d = Radians{1.40} + 10;
   double a;
   Degrees a;
   double f = a;
   Degrees b = Pi/4;

   Angle a = Degrees{30};
   Radians a = Degrees{30};
   Degrees yo = Degrees{30} + Radians{30};
   Degrees a = Degrees { Radians { 1.40 } };    // 1.40
   Degrees a = Degrees { 30 };    // 30 degrees in radians

   Feet b = Meters{5};
   Meters a = Feet{5 + 8/12.0};
   double a = (Meters)Feet{5 + 8/12.0};

   double a = Feet{5};

   WorldPoint a = PolarPoint { 30, 10 };
   PolarPoint a = WorldPoint { 50, 40 };
   GeoPoint a { 50, 30 };

   double a = Degrees{20} + 25;
   double a = 25 + Degrees{20};

   (Radians)Degrees{45} * 4;
   (double)(Degrees{20} + 25);

   (double)(Degrees{20} + 25);

   (double)(25 + Degrees{20});

   (double)(25 + Degrees{20});

   (double)(Feet)Meters{5};
   (double)(Degrees)Radians{5};
}

Multi-cast delegate: you're quite far now... Is this a C# specific thing?
eC is meant to be an extension to C, and as such this can probably be done with regular C function pointers.
Super type safety is not a primary design goal of eC...

Regards,

Jerome




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "eC Programming Language" group.
To post to this group, send email to ec-programming-language-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to ec-programming-language+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at http://groups.google.ca/group/ec-programming-language?hl=en
-~----------~----~----~----~------~----~------~--~---

Sam Hu | 6 Aug 2008 02:52
Picon

Re: characters/struct/enum/examples in the Dao


Hi Jerome,

Learning...
One more question:How to pop up a messagebox when one click on a
control,say a button,just like :
MessageBox(NULL,"Title","msg",MB_INFORMATION);

Regards,
Sam

On Aug 6, 12:00 am, "Jerome St-Louis" <jerstlo...@...> wrote:
> Hi Sam,
>
> The truth is that Windows console simply doesn't support UTF-8, as I found
> out recently trying to set it up myself...
> There was a hack which apparently worked at one point, setting the codepage
> to a particular ID which represents UTF-8.
>
> See the following:
>
> http://www.google.ca/search?hl=en&safe=off&q=SetConsoleOutputCP+utf-8...
>
> http://blogs.msdn.com/michkap/archive/2007/05/11/2547703.aspx
>
> http://www.tek-tips.com/viewthread.cfm?qid=1428936&page=2
>
> http://msdn.microsoft.com/en-us/library/ms686036(VS.85).aspx
>
> SetConsoleOutputCP( 65001 ) // that is supposed to set the console to UTF-8
>
> However that command fails for me.
>
> Please let me know if you do manage to make it work :)
>
> Why is Linux better? This particular thing is just one example...
> The fact that Linux is open and free is a big plus also.
>
> Operator Overloading:
>
> I'm hoping to support it in a future version of eC. However at the moment
> much can be done with the "conversion properties" of eC for scalar types,
> which would normally require operator overloading if they were C++ classes.
> Related units can be added, subtracted together.
>
> For support in Vectors per example, I will have to add extra support to
> specify how vectors are to be operated upon...
> Here's some sample code:
>
> void Main()
> {
>    ColorRGB a = Color { 255, 0, 0 };
>    Color c = ColorRGB { 0.35f, 1.0f, 1.0f };
>    ColorRGB a = Red;
>    ColorHSV a = ColorHSV { Degrees{90}, 100, 100 };
>    ColorHSV a = ColorHSV { 90, 100, 100 };
>    ColorRGB a = ColorHSV { 90, 100, 100 };
>    ColorRGB a = ColorHSV { Degrees { 90 }, 100, 100 };
>    Color a = ColorHSV { 100, 40, 30 };
>    Color a = ColorHSV { 0, 50, 100 };
>    Color a = ColorRGB { 1, 0.3f, 0.3f };
>    Color c = ColorRGB { 0.35f, 1.0f, 1.0f };
>    ColorRGB a = Red;
>    ColorRGB a = ColorHSV { 1, 0.3f, 0.3f };
>    ColorCMYK a = ColorHSV { 90, 60, 40 };
>    ColorLab a = Red;
>    ColorHSV a = ColorHSV { Pi/8, 100, 100 };
>    ColorHSV a = ColorRGB { 1, 0.3f, 0.3f };
>    ColorHSV a = Color { 40, 130, 30 };
>    ColorHSV a = ColorRGB { 40/255.0f, 130/255.0f, 30/255.0f };
>    ColorHSV a = Red;
>    ColorHSV a = Indigo;
>    ColorHSV a = ColorLab { 30, 60, -40 };
>    ColorHSV a = ColorRGB { 1, 0.3f, 0.3f };
>    ColorHSV a = Color { 40, 130, 30 };
>    ColorHSV a = ColorLab { 40, 60, 30 };
>    ColorHSV a = Red;
>    Color a = ColorHSV { a, 40, 30 };
>    double a = 4 + Pi;
>    double a = Pi + 4;
>    double a = 4 + Pi + 0;
>    double a = Pi + 4 + 0;
>    double a = 0 + 4 + Pi;
>    double a = 0 + Pi + 4;
>    double a = Radians{0} + Pi;
>    double a = Degrees{0} + Degrees{30};
>    Degrees a = Radians{Pi/4} + 45;
>    Degrees a = Radians{Pi/4} + 20 + Degrees{30};
>    Degrees a = Radians{Pi/4} + Pi/8 + Degrees{30} + Pi/4;
>    Degrees a = Radians{0} + Pi;
>    Degrees a {Radians{Pi/2}};
>    double a = Radians{Pi/4} + Degrees{30};    // Make this a warning...
>    double a = Degrees{30} + Radians{Pi/4};    // Make this a warning...
>    double a = (Degrees)Radians{Pi};
>    Degrees a = Radians{Pi/2};
>    Degrees a = Radians{Pi/4};
>    double a = (Radians)Degrees{45};
>    double a = Degrees{30} / 4;
>    double a = Degrees{30} + Pi/4;      // This should generate a warning...
>    double a = Degrees{30} + Pi/8 ;     // This should generate a warning...
>    double a = Radians{Pi/4} + Pi/8 + Degrees{30} + Pi/4; // This should
> generate a warning...
>    Radians a = Degrees{30};
>
>    Radians a = (Radians)Degrees{45} * 4;
>    Radians a = Degrees{45} * 4;
>    Radians a = Degrees{20} + 25;
>
>    Degrees a = Degrees{Radians{10}};
>
>    Degrees a = Degrees{60};
>    Radians a = Degrees{Radians { Pi/2 }};
>
>    Radians a = Degrees{Pi/2};
>    double a = (Degrees) (Pi/4);
>    Degrees a;
>    Radians b = a;
>
>    double a = (Degrees)Radians{Pi};
>    Degrees a = Pi/4;
>    double a;
>    double e = Degrees{60};
>    double e = Degrees{a};
>
>    double dbl;
>    Degrees deg;
>
>    Degrees a = Degrees { dbl };
>    Degrees a = Degrees { deg };
>    Degrees a = Degrees { Degrees { dbl } };
>    Degrees a = Degrees { a };
>
>    Degrees a = Degrees { Degrees { 30 } };
>    Degrees a = Degrees { 60 };
>    Degrees c = Radians{1.40};
>    Degrees d = Radians{1.40} + 10;
>    double a;
>    Degrees a;
>    double f = a;
>    Degrees b = Pi/4;
>
>    Angle a = Degrees{30};
>    Radians a = Degrees{30};
>    Degrees yo = Degrees{30} + Radians{30};
>    Degrees a = Degrees { Radians { 1.40 } };    // 1.40
>    Degrees a = Degrees { 30 };    // 30 degrees in radians
>
>    Feet b = Meters{5};
>    Meters a = Feet{5 + 8/12.0};
>    double a = (Meters)Feet{5 + 8/12.0};
>
>    double a = Feet{5};
>
>    WorldPoint a = PolarPoint { 30, 10 };
>    PolarPoint a = WorldPoint { 50, 40 };
>    GeoPoint a { 50, 30 };
>
>    double a = Degrees{20} + 25;
>    double a = 25 + Degrees{20};
>
>    (Radians)Degrees{45} * 4;
>    (double)(Degrees{20} + 25);
>
>    (double)(Degrees{20} + 25);
>
>    (double)(25 + Degrees{20});
>
>    (double)(25 + Degrees{20});
>
>    (double)(Feet)Meters{5};
>    (double)(Degrees)Radians{5};
>
> }
>
> Multi-cast delegate: you're quite far now... Is this a C# specific thing?
> eC is meant to be an extension to C, and as such this can probably be done
> with regular C function pointers.
> Super type safety is not a primary design goal of eC...
>
> Regards,
>
> Jerome
Jerome St-Louis | 6 Aug 2008 03:37
Picon

Re: characters/struct/enum/examples in the Dao

   Button button1
   {
      this, text = "button1";

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         MessageBox { text = "Title", contents = "msg", type = ok }.Modal();
         return true;
      }
   };

Sam Hu | 6 Aug 2008 09:19
Picon

Re: characters/struct/enum/examples in the Dao


Hi Jerome,

Great,how to adding an icon in the MessageBox?I searched the API but
no found such enumeration.

Regards,
Sam

On Aug 6, 9:37 am, "Jerome St-Louis" <jerstlo...@...> wrote:
>    Button button1
>    {
>       this, text = "button1";
>
>       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
>       {
>          MessageBox { text = "Title", contents = "msg", type = ok }.Modal();
>          return true;
>       }
>    };
Jerome St-Louis | 6 Aug 2008 13:30
Picon

Re: characters/struct/enum/examples in the Dao

Hi Sam,

There is no built in way to add an icon to the MessageBox.

However you can write a new class deriving from MessageBox, and override it
to display an icon in the OnRedraw method, or simply by inserting a Picture
control inside. You can have an array of icons mapping to the "type"
MessageBox enumeration.

class MyIconMessageBox :  MessageBox
{
   Picture icon { this, image = ":icon.png", position = ... };

   or

   void OnRedraw(Surface surface)
   {
      MessageBox::OnRedraw(surface); // Chain default MessageBox OnRedraw
      // Draw Icon Here
   }
}

Regards,

Jerome


Gmane