Thema: Delphi resize beim formular

Einzelnen Beitrag anzeigen

LoL
(Gast)

n/a Beiträge
 
#9
  Alt 18. Mai 2003, 21:28
hier ist der ganze risize code:

Delphi-Quellcode:
procedure Tfrm_eingabe.FormResize(Sender: TObject);
var i_lrand : byte;
    i_rdgp_abstand : byte;
    i_edit_abstand : byte;
    i_zeilenabstand: byte;
begin
  draw;

  i_lrand := 20;
  i_rdgp_abstand := 5;
  i_edit_abstand := 28;
  i_zeilenabstand:= 8;

  if frm_eingabe.width < 800 then
  frm_eingabe.width := 800;
  if frm_eingabe.height < 600 then
  frm_eingabe.height := 600;

  //Button Verlassen
  sb_close.Top := frm_eingabe.height - 90;
  //Panel Einagbe
  p_eingabe.width := frm_eingabe.width - p_button.width - 79;
  p_eingabe.height := p_prg_wahl.height - 40;
  //Panel Optionen
  p_optionen.width := p_eingabe.Width;
  p_optionen.height := p_eingabe.Height;
  //Graph
  c_graph.Height := frm_eingabe.height div 2 - (p_prg_wahl.height - p_eingabe.height);
  c_graph.width := p_eingabe.width;

  //Gruppe1: Radiogroup-Prozess
  rdgp_prozess.top := frm_eingabe.height div 2;
  rdgp_prozess.left := frm_eingabe.width div i_lrand - 10;
  //Gruppe2: Radiogroup-Schritt
  rdgp_schritt.top := rdgp_prozess.top;
  rdgp_schritt.left := rdgp_prozess.left + rdgp_prozess.width + i_rdgp_abstand;
  //Gruppe3: Panel Eingabe_Maske
  p_eingabe_maske.Top := rdgp_prozess.top + 5;
  p_eingabe_maske.left := rdgp_schritt.left + rdgp_schritt.width + i_rdgp_abstand;
  //Gruppe4:Group Box Beschriftung
  gbx_beschriftung.Top := rdgp_schritt.Top ;
  gbx_beschriftung.Left := p_eingabe_maske.Left + p_eingabe_maske.Width + i_rdgp_abstand;

  //zu Gruppe 3:
  //links1: Text Temperatur
  stctxt_temp.Top := p_eingabe_maske.Top + i_zeilenabstand + 4;
  stctxt_temp.Left := p_eingabe_maske.left + i_zeilenabstand;
  //links2: Combobox Gradient/Zeit
  cb_gdz.Top := stctxt_temp.Top + stctxt_temp.Height + i_zeilenabstand;
  cb_gdz.Left := stctxt_temp.Left;
  //links3: Combobox Zugabe
  cb_zugabe.Top := cb_gdz.Top + cb_gdz.Height + i_zeilenabstand;
  cb_zugabe.Left := stctxt_temp.Left;
  //links4: Text Schrittbezeichnung
  stctxt_schrittbezeichnung.Top := cb_zugabe.Top + cb_zugabe.Height + i_zeilenabstand + 4;
  stctxt_schrittbezeichnung.left :=stctxt_temp.Left;
  //links5: Combobox next step
  cb_nextstep.Top := cb_zugabe.Top + 2*(cb_zugabe.Height + i_zeilenabstand);
  cb_nextstep.Left := stctxt_temp.Left;

  //rechts1: Edit Temperatur
  ed_temp.Top := p_eingabe_maske.Top + i_zeilenabstand;
  ed_temp.Left := p_eingabe_maske.left + cb_gdz.width + i_lrand;

  //rechts1++: Text °C
  stctxt_einheit_temp.Top := stctxt_temp.Top;
  stctxt_einheit_temp.Left := ed_temp.Left + ed_temp.width + i_rdgp_abstand;
  //rechts2: Edit Zeit/Gradient
  ed_gdz.Top := cb_gdz.Top;
  ed_gdz.Left := ed_temp.Left;
  //rechts2**: Text min / °C/min
  stctxt_einheit_gdz.Top := stctxt_einheit_temp.Top + stctxt_einheit_temp.Height + i_zeilenabstand + 4;
  stctxt_einheit_gdz.left := ed_gdz.Left + ed_gdz.width + i_rdgp_abstand;
  //rechts3: Edit Portionen
  ed_port_zahl.Top := cb_zugabe.Top;
  ed_port_zahl.Left := ed_temp.Left;
  //rechts4: Edit Schrittbezeichnung
  ed_schrittbezeichnung.Top := stctxt_schrittbezeichnung.Top;
  ed_schrittbezeichnung.Left := ed_temp.Left;
  //rechts5: Edit Prozessname
  cb_prozessname.Top := cb_nextstep.Top;
  cb_prozessname.Left := ed_temp.Left;

  // Checkbox Schrittpanel_view
  chb_Schrittpanel_view.Top := gbx_beschriftung.Top + 20;
  chb_Schrittpanel_view.Left := gbx_beschriftung.Left + i_rdgp_abstand;
  // Checkbox Haltezeit
  chb_haltezeit.Top := chb_Schrittpanel_view.Top + chb_Schrittpanel_view.Height + i_zeilenabstand;
  chb_haltezeit.Left := chb_Schrittpanel_view.Left;
  // Checkbox Gradient
  chb_gradient.Top := chb_haltezeit.Top + chb_haltezeit.Height + i_zeilenabstand;
  chb_gradient.Left := chb_Schrittpanel_view.Left;

  //Button OK
  btn_ok.Top := cb_nextstep.Top + i_edit_abstand + 8;
  btn_ok.Left := p_eingabe_maske.Left;
  //Button Reset Prozess
  btn_reset_proz.Top := btn_ok.Top ;
  btn_reset_proz.Left := rdgp_prozess.left;
  //Button Reset Schritt
  btn_reset_schritt.Top := btn_ok.Top ;
  btn_reset_schritt.Left := rdgp_schritt.left;
end;
in draw lösche ich zuerst alle komponenten und dann erzeuge ich sie neu an der richtigen x-bzw.y-koordinate am bildschrim!
  Mit Zitat antworten Zitat