Changeset 636 for trunk/ab5.0


Ignore:
Timestamp:
Sep 28, 2008, 7:27:20 AM (16 years ago)
Author:
NoWest
Message:

Staticなメンバ変数にConsoleColorを指定するとなぜかエラーになるようなので、
直接文字列バッファの属性を保持する方法に変更しました。

これでResetColorの問題は直ったはずです。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/System/Console.ab

    r635 r636  
    522522    Static Sub OpenStandardOutput()
    523523        Console.SetOut(System.IO.TextWriter.Synchronized(New System.IO.StreamWriter(New System.IO.FileStream(GetStdHandle(STD_OUTPUT_HANDLE), System.IO.FileAccess.Write, False))))
    524         Console.defBC = Console.BackgroundColor()
    525         Console.defFC = Console.ForegroundColor()
     524        Console.defBC = This.ConsoleColorToTextAttribute(Console.BackgroundColor)
     525        Console.defFC = This.ConsoleColorToTextAttribute(Console.ForegroundColor)
    526526    End Sub
    527527
     
    532532    */
    533533    Static Sub ResetColor()
    534         Console.BackgroundColor(Console.defBC)
    535         Console.ForegroundColor(Console.defFC)
     534        Console.BackgroundColor = TextAttributeToConsoleColor(Console.defBC)
     535        Console.ForegroundColor = TextAttributeToConsoleColor(Console.defFC)
    536536    End Sub
    537537
     
    661661    Static err = Nothing As IO.TextWriter
    662662    Static cs = Nothing As ActiveBasic.Windows.CriticalSection
    663     Static defBC As ConsoleColor
    664     Static defFC As ConsoleColor
     663    Static defBC As Word
     664    Static defFC As Word
    665665End Class
    666666
Note: See TracChangeset for help on using the changeset viewer.