Welcome, Guest
Username: Password: Remember me
Components and Libraries for Graphics Development, discussions, problems and suggestions.

TOPIC:

TD2Calendar not finished? 10 years 11 months ago #3828

  • RockyLuck
  • RockyLuck's Avatar Topic Author
  • Visitor
  • Visitor

RockyLuck wrote:

procedure TD2Calendar.WeekDay0ApplyResource(Sender : TObject);     // *** DB ***
var
   T: TD2Object;
   B: TD2Brush;

   procedure FillButton(btn: TD2Button);
   var
      T: TD2Object;
   begin
      T := btn.FindResource('calendarcontrol');
      if (T <> nil) and (T is TD2Shape) then begin
         TD2Shape(T).Stroke.Assign(B);
         TD2Shape(T).Fill.Assign(B);
      end{if};
   end;

   procedure FillTxtFont(lbl: TD2TextControl);
   var
      T: TD2Object;
   begin
      T := lbl.FindResource('text');
      if (T <> nil) and (T is TD2Text) then begin
         TD2Text(T).Fill.Assign(B);
      end{if};
   end;

begin
   B := TD2Brush.Create(d2BrushSolid, $FFFFFFFF);
   Try
      T := Sender as TD2Label;
      T := TD2Label(T).FindResource('text');
      if (T <> nil) and (T is TD2Text) then B.Assign(TD2Text(T).Fill)
                                       else Exit;
      FillButton(FPrev);
      FillButton(FToday);
      FillButton(FNext);

      FillTxtFont(FMonths);
      FillTxtFont(FYears);
   finally
      B.Free;
   end{try};
end;                                                               // *** DB ***


Hi Sternas,

I really need your help now with this. For a normal calendar, this code works. However, in a TD2CalendarTextBox the code only works after the user has clicked in the calendar :side: In other words: the controls are not refreshed immediately. I have tried Refresh, Repaint, InvalidateRect, etc. etc. Nothing seems to work. The problem must be in this piece of coding.

Can you shed some light on this?

Thanks ;-}
Dick

Please Log in or Create an account to join the conversation.

TD2Calendar not finished? 10 years 11 months ago #3829

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4508
  • Thank you received: 1100
Give me time to solve this
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

TD2BitmapEditor aborts 10 years 11 months ago #3832

  • RockyLuck
  • RockyLuck's Avatar Topic Author
  • Visitor
  • Visitor
The TD2BitmapEditor produces a SIGSEGV exception at Create time.
The reason is that during loading of the form, width and height of two TD2NumberBoxes change, producing the newWidthChange and newHeightChange events. These event procedures refer to FBitmap, which has not been created yet.

This is the fix:
procedure TD2BitmapEditor.newWidthChange(Sender: TObject);
begin
  if not (csLoading in ComponentState) then                        // *** DB ***
     newHeight.Value := Round(newWidth.Value * (FBitmap.Height / FBitmap.Width));
end;

procedure TD2BitmapEditor.newHeightChange(Sender: TObject);
begin
  if not (csLoading in ComponentState) then                        // *** DB ***
     newWidth.Value := Round(newHeight.Value * (FBitmap.Width / FBitmap.Height));
end;
Thanks ;-}

Dick

Please Log in or Create an account to join the conversation.

TfrmParticleDesign has never worked like this!! 10 years 11 months ago #3833

  • RockyLuck
  • RockyLuck's Avatar Topic Author
  • Visitor
  • Visitor
I'm really getting a bit annoyed by this.
I had to conclude that TD2BitmapEditor could not work, because of the SIGSEGV exception.
Now I have to find that the particle editor TfrmParticleDesign in module orca_editor_particle.pas can never have worked :angry: . Just try the example in C:\codetyphon\CodeOcean\ORCA\samples3d\particle. Click the "Show Editor ... " button and that's it.

I'll just give the needed patches:

At the start of the module:
    .
    .
    procedure trackFrictionChange(Sender: TObject);
  private
    InQuad1Edit: Integer;                                          // *** DB ***
    InQuad2Edit: Integer;                                          // *** DB ***
    FParentScene: TD3Scene;
    FMousePressed: boolean;
    { Private declarations }
    procedure RebuildBitmapList;
    procedure SetParentScene(const Value: TD3Scene);
    .
    .
Then further down changes are needed for ColorQuad1 and ColorQuad2:
procedure TfrmParticleDesign.numRChange(Sender: TObject);
var
  Color: TD3Color;
begin
  if csDestroying in ComponentState then Exit;                     // *** DB ***
  Color := ColorPicker1.Color;
  TD3ColorRec(Color).R := trunc(numR.Value);
  TD3ColorRec(Color).G := trunc(numG.Value);
  TD3ColorRec(Color).B := trunc(numB.Value);
  TD3ColorRec(Color).A := trunc(numA.Value);
  textRGBA.Text := d3ColorToStr(ColorBox1.Color);
  if InQuad1Edit = 0 then ColorPicker1.Color := Color;             // *** DB ***
  partGrad.Fill.Gradient.Points[0].Color := textRGBA.Text;
  if InQuad1Edit = 0 then partGrad.Repaint;                        // *** DB ***
end;

procedure TfrmParticleDesign.textRGBAChange(Sender: TObject);
begin
  if InQuad1Edit = 0 then                                          // *** DB ***
          ColorPicker1.Color := d3StrToColor(textRGBA.Text);
end;

procedure TfrmParticleDesign.ColorQuad1Change(Sender: TObject);
begin
  Inc(InQuad1Edit);                             // Prevent Event loop *** DB ***
  Try                                                              // *** DB ***
     Emitter.ColorBegin := d3ColorToStr(ColorBox1.Color);
     numR.Value := TD3ColorRec(ColorBox1.Color).R;
     numG.Value := TD3ColorRec(ColorBox1.Color).G;
     numB.Value := TD3ColorRec(ColorBox1.Color).B;
     numA.Value := TD3ColorRec(ColorBox1.Color).A;
     textRGBA.Text := d3ColorToStr(ColorBox1.Color);
     partGrad.Fill.Gradient.Points[0].Color := textRGBA.Text;
     partGrad.Repaint;
  finally                                                          // *** DB ***
     Dec(InQuad1Edit);                                             // *** DB ***
  end{try};                                                        // *** DB ***
end;
.
.
.
procedure TfrmParticleDesign.numR2Change(Sender: TObject);
var
  Color: TD3Color;
begin
  if csDestroying in ComponentState then Exit;                     // *** DB ***
  Color := ColorPicker2.Color;
  TD3ColorRec(Color).R := trunc(numR2.Value);
  TD3ColorRec(Color).G := trunc(numG2.Value);
  TD3ColorRec(Color).B := trunc(numB2.Value);
  TD3ColorRec(Color).A := trunc(numA2.Value);
  textRGBA2.Text := d3ColorToStr(ColorBox2.Color);
  partGrad.Fill.Gradient.Points[1].Color := textRGBA2.Text;
  if InQuad2Edit = 0 then begin                                    // *** DB ***
     partGrad.Repaint;
     ColorPicker2.Color := Color;
  end{if};                                                         // *** DB ***
end;

procedure TfrmParticleDesign.textRGBA2Change(Sender: TObject);
begin
  if InQuad2Edit = 0 then                                          // *** DB ***
     ColorPicker2.Color := d3StrToColor(textRGBA.Text);
end;

procedure TfrmParticleDesign.ColorQuad2Change(Sender: TObject);
begin
  Inc(InQuad2Edit);                             // Prevent Event loop *** DB ***
  Try                                                              // *** DB ***
     Emitter.ColorEnd := d3ColorToStr(ColorBox2.Color);
     numR2.Value := TD3ColorRec(ColorBox2.Color).R;
     numG2.Value := TD3ColorRec(ColorBox2.Color).G;
     numB2.Value := TD3ColorRec(ColorBox2.Color).B;
     numA2.Value := TD3ColorRec(ColorBox2.Color).A;
     textRGBA2.Text := d3ColorToStr(ColorBox2.Color);
     partGrad.Fill.Gradient.Points[1].Color := textRGBA2.Text;
     partGrad.Repaint;
  finally                                                          // *** DB ***
     Dec(InQuad2Edit);                                             // *** DB ***
  end{try};                                                        // *** DB ***
end;

Please Log in or Create an account to join the conversation.

Bugs found in pl_Orca 10 years 10 months ago #4015

  • DEADCODE
  • DEADCODE's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
I found small inaccuracy in orca_scene2d_obj_calendars.inc

Need to change this line:
TD2Label(FWeek.Children[i]).TextW := ShortDayNames[1 + ((7 + i + FFirstDayOfWeekNum) mod 7)];
to this:
TD2Label(FWeek.Children[i]).TextW := UTF8Encode(ShortDayNames[1 + ((7 + i + FFirstDayOfWeekNum) mod 7)]);

so If you are using a language other than English record "week days" will be looks like "??", "??", "??" ;) :)

Hope it was useful!

Please Log in or Create an account to join the conversation.

Last edit: by DEADCODE.

TD2Calendar not finished? 10 years 9 months ago #4164

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4508
  • Thank you received: 1100
No yet Sir
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Bugs found in pl_Orca 10 years 5 months ago #4684

  • universe
  • universe's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 122
  • Thank you received: 8
Hello,I just discovered a bug in a basic function, find attached a simple program with TD2Button that has the Text property set, run the program and click on the button you get a SIGSEGV exception, empty the Text property the program works fine. The same bug exists with all descendant buttons controls it seems (dropdownbutton,roundbutton...)
Thanks.
I'm using ubuntu 13.10 32Bit with CT4.2 (pl_ORCA 3.4),
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by universe. Reason: Adding more details

Bugs found in pl_Orca 10 years 5 months ago #4686

  • universe
  • universe's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 122
  • Thank you received: 8
Hello, by the way it's a platform dependent bug, as it doesn't exist on Windows.
Thanks

Please Log in or Create an account to join the conversation.

Bugs found in pl_Orca 10 years 5 months ago #4687

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4508
  • Thank you received: 1100
Thanks Sir
we know this bug and we will fix-it
and please your help
PilotLogic Architect and Core Programmer
The following user(s) said Thank You: universe

Please Log in or Create an account to join the conversation.

Bugs found in pl_Orca 10 years 5 months ago #4747

  • Helder R. C.
  • Helder R. C.'s Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
Hello!
I am not able to use the component TD2DBGrid (orca) correctly. It seems that the component is not ready, or am I doing something wrong. I am attaching two projects, one with TDBGrid component, that works, and another with component TD2DBGrid, what does not.
I can not give the "post" effectively after inserting or editing.
Can anyone tell me if I'm doing something wrong?
Thank you!
CT 4.5, windows vista 32 bits.
Attachments:

Please Log in or Create an account to join the conversation.