Cores e fontes
This commit is contained in:
parent
4b7f5a1f3b
commit
754589f8d2
37
BrainFuck.m
37
BrainFuck.m
|
@ -54,21 +54,6 @@ objectValueForTableColumn:(NSTableColumn *) aTableColumn
|
||||||
[memoryDisplay setDataSource: myMemory];
|
[memoryDisplay setDataSource: myMemory];
|
||||||
|
|
||||||
[stepoutButton setEnabled: NO];
|
[stepoutButton setEnabled: NO];
|
||||||
/*
|
|
||||||
[inputCode setTypingAttributes:
|
|
||||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
|
||||||
[NSColor greenColor],
|
|
||||||
NSForegroundColorAttributeName,
|
|
||||||
[NSColor blackColor],
|
|
||||||
NSBackgroundColorAttributeName, nil]];
|
|
||||||
[inputCode setFont:[NSFont fontWithName:@"Monaco" size:10]];
|
|
||||||
[inputCode setSelectedTextAttributes:
|
|
||||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
|
||||||
[NSColor selectedControlTextColor],
|
|
||||||
NSForegroundColorAttributeName,
|
|
||||||
[NSColor grayColor],
|
|
||||||
NSBackgroundColorAttributeName, nil]];
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -208,10 +193,7 @@ objectValueForTableColumn:(NSTableColumn *) aTableColumn
|
||||||
unichar memChar = [memValue intValue];
|
unichar memChar = [memValue intValue];
|
||||||
|
|
||||||
// Variaveis temporarias para escrever na NSTextView
|
// Variaveis temporarias para escrever na NSTextView
|
||||||
// TODO: Tem de haver uma maneira mais simples de fazer isto
|
|
||||||
NSString *memCharStr;
|
NSString *memCharStr;
|
||||||
NSAttributedString *memAttrStr;
|
|
||||||
NSTextStorage *myOut;
|
|
||||||
|
|
||||||
switch(myCode[programPosition])
|
switch(myCode[programPosition])
|
||||||
{
|
{
|
||||||
|
@ -237,20 +219,11 @@ objectValueForTableColumn:(NSTableColumn *) aTableColumn
|
||||||
case '.':
|
case '.':
|
||||||
// Mete a NSString com o valor do unichar c
|
// Mete a NSString com o valor do unichar c
|
||||||
memCharStr = [NSString stringWithCharacters: &memChar length:1];
|
memCharStr = [NSString stringWithCharacters: &memChar length:1];
|
||||||
// Cria preenche uma NSAttributedString com o valor da NSString
|
[[outputText textStorage]
|
||||||
memAttrStr = [[NSAttributedString alloc] initWithString:memCharStr
|
replaceCharactersInRange:NSMakeRange([[outputText textStorage] length],
|
||||||
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
0) withString:memCharStr];
|
||||||
[NSColor whiteColor],
|
[outputText scrollRangeToVisible:NSMakeRange([[outputText textStorage]
|
||||||
NSForegroundColorAttributeName,
|
length], 0)];
|
||||||
[NSColor blackColor],
|
|
||||||
NSBackgroundColorAttributeName, nil]];
|
|
||||||
// O storage fica com o conteudo actual da NSTextView de Output (Acho eu)
|
|
||||||
myOut = [outputText textStorage];
|
|
||||||
[myOut beginEditing];
|
|
||||||
// Adiciona a string ao final do storage
|
|
||||||
[myOut appendAttributedString:memAttrStr];
|
|
||||||
[myOut endEditing];
|
|
||||||
[outputText scrollRangeToVisible: NSMakeRange ([[outputText string] length], 0)];
|
|
||||||
break;
|
break;
|
||||||
/* Le o valor e guarda-o na posicao de memoria actual */
|
/* Le o valor e guarda-o na posicao de memoria actual */
|
||||||
case ',':
|
case ',':
|
||||||
|
|
|
@ -10,8 +10,7 @@
|
||||||
<integer>5</integer>
|
<integer>5</integer>
|
||||||
<key>IBOpenObjects</key>
|
<key>IBOpenObjects</key>
|
||||||
<array>
|
<array>
|
||||||
<integer>2</integer>
|
<integer>233</integer>
|
||||||
<integer>213</integer>
|
|
||||||
</array>
|
</array>
|
||||||
<key>IBSystem Version</key>
|
<key>IBSystem Version</key>
|
||||||
<string>9L31a</string>
|
<string>9L31a</string>
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue