Cores e fontes

This commit is contained in:
Pedro de Oliveira 2011-07-04 22:57:43 +01:00
parent 4b7f5a1f3b
commit 754589f8d2
3 changed files with 6 additions and 34 deletions

View File

@ -54,21 +54,6 @@ objectValueForTableColumn:(NSTableColumn *) aTableColumn
[memoryDisplay setDataSource: myMemory];
[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];
// Variaveis temporarias para escrever na NSTextView
// TODO: Tem de haver uma maneira mais simples de fazer isto
NSString *memCharStr;
NSAttributedString *memAttrStr;
NSTextStorage *myOut;
switch(myCode[programPosition])
{
@ -237,20 +219,11 @@ objectValueForTableColumn:(NSTableColumn *) aTableColumn
case '.':
// Mete a NSString com o valor do unichar c
memCharStr = [NSString stringWithCharacters: &memChar length:1];
// Cria preenche uma NSAttributedString com o valor da NSString
memAttrStr = [[NSAttributedString alloc] initWithString:memCharStr
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
[NSColor whiteColor],
NSForegroundColorAttributeName,
[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)];
[[outputText textStorage]
replaceCharactersInRange:NSMakeRange([[outputText textStorage] length],
0) withString:memCharStr];
[outputText scrollRangeToVisible:NSMakeRange([[outputText textStorage]
length], 0)];
break;
/* Le o valor e guarda-o na posicao de memoria actual */
case ',':

View File

@ -10,8 +10,7 @@
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>2</integer>
<integer>213</integer>
<integer>233</integer>
</array>
<key>IBSystem Version</key>
<string>9L31a</string>

Binary file not shown.