Here's my solution in Pseudocode:
void QGraphicsDialog::on_aspectration_toggled()
begin
// set the same unit for width and height
if Index(widthUnit) != Index(heightUnit) then
Index(heightUnit) = Index(widthUnit);
// only the smaller value is used by LaTeX when aspectratio is on
// therefore set the greater value to the smaller one
if (Value(Width) < Value(Height)) and (Value(Width) > 0) then
Value(Height) = Value(Width)
else
Value(Width) = Value(Height);
end;
void QGraphicsDialog::on_Height_textChanged()
begin
if aspectration->isChecked() then
begin
if (Value(Width) < Value(Height)) and (Value(Width) > 0) then
Value(Height) = Value(Width)
else
Value(Width) = Value(Height);
end;
end;
void QGraphicsDialog::on_Width_textChanged()
begin
if aspectration->isChecked() then
begin
if (Value(Width) < Value(Height)) and (Value(Width) > 0) then
Value(Height) = Value(Width)
else
Value(Width) = Value(Height);
end;
end;
This is simple and logic. I wrote it down here in Pseudocode as I still fail to implement this easy
code in GraphicsDialog.C (I fail to manage that QGraphicsDialog::on_Width_textChanged() is really
called when the text is changed - I' too stupid!).
But besides this, what do you think of this solution? This method is more simple then translating
something from "0" to "auto" and is easily explicable in the docs.
Richard?
regards Uwe