Fórum quot;switchquot; de C , como uso no delphi? #286782
04/07/2005
0
[b:43a5f1056d][color=blue:43a5f1056d]Estou tentando reescrever um código C++ em Delphi.
Encontrei o[/color:43a5f1056d][/b:43a5f1056d] [color=black:43a5f1056d][b:43a5f1056d]switch[/b:43a5f1056d][/color:43a5f1056d][b:43a5f1056d][color=blue:43a5f1056d], e agora nao sei o q usar no lugar dele... [/color:43a5f1056d][/b:43a5f1056d]
[color=red:43a5f1056d][b:43a5f1056d]em C[/b:43a5f1056d][/color:43a5f1056d]
switch (alinhamento){
case taLeftJustify:
esq = Rect.Left + 3;
break;
case taRightJustify:
esq = Rect.Right - bmp->Width - 3;
break;
default:
esq = Rect.Left +
(Rect.Width() - bmp->Width)/2;
break;
}
[color=red:43a5f1056d][b:43a5f1056d]em Delphi:[/b:43a5f1056d][/color:43a5f1056d]
switch (alinhamento) begin case (alinhamento) of taLeftJustify : esq:= Rect.Left + 3; taRightJustify: esq:= Rect.Right - (bmp.Width - 3); default : esq:= Rect.Left + (Rect.Width() - bmp.Width)/2; end; end;
[b:43a5f1056d][color=red:43a5f1056d]Como q eu faço?[/color:43a5f1056d][/b:43a5f1056d]
[b:43a5f1056d]Valeu...[/b:43a5f1056d]
Michelli88
Curtir tópico
+ 0Posts
04/07/2005
Cabelo
Se entendí bem, esse switch é para alinha corretamente a Imagem, certo..
No delphi, você tem a possíbilidade de usar as propriedade, Stretch do TImage, juntamente com a propriedade AutoSize..
Gostei + 0
04/07/2005
Rjun
case alinhamento of taLeftJustify: esq = Rect.Left + 3; taRightJustify: esq = Rect.Right - bmp->Width - 3; else esq = Rect.Left + end;
Gostei + 0
04/07/2005
Michelli88
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)