| Autor |
Beitrag |
ash25
Hält's aus hier
Beiträge: 13
Delphi 7 Personal
|
Verfasst: So 15.05.05 14:25
Hallo Leute
Hab nochmal ne Frage. Und zwar hab ich eine Hauptunit inkl dem entsprechenden Formular auf dem sich nen Laden/Öffnen Button befindet, ebenso der entsprechende Dialog dazu. Der Übersicht halber habe ich eine zweite Unit SpeichernLaden angelegt und in dieser die Anweisungen geschrieben die passieren sollen wenn der Button Laden gedrückt wird.
Nun hab ich mich durch alle möglichen Tutorial gewühlt und Google ordentlich ausgequetscht und meiner Meinung auch alles so gemacht wie es bei der Verwendung von einer Unit in einer anderen sein muss, trotzdem bekomm ich den Fehler undefinierter Bezeichner. Ist wahrscheinlich nen totaler Noob-Fehler, aber dass bin ich ja auch noch
Hier die entsprechenden Passagen der Hauptunit:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35:
| unit U_Rotationskoerper_HF;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, StdCtrls, Grids, ExtCtrls, math, ComCtrls, Buttons,Printers, ImgList,IniFiles,U_SpeichernLaden_HF; type TF_Rotationskoerper_HF = class(TForm) BOeffnen: TButton; BSichern: TButton; PrintDialog1: TPrintDialog; OpenDialog1: TOpenDialog; SaveDialog1: TSaveDialog; procedure BOeffnenClick(Sender: TObject);
private public end;
var F_Rotationskoerper_HF: TF_Rotationskoerper_HF;
implementation
{$R *.dfm} {$R Bilder.RES}
procedure TF_Rotationskoerper_HF.BOeffnenClick(Sender: TObject); begin Laden; end; |
Und hier die Unit die die Prozedur Laden beinhaltet. Ob die Prozedur ansich das tut was sie nachher soll ist noch fraglich, aber mir gehts erstmal darum dass überhaupt die Prozedur aufgerufen wird.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74:
| unit U_SpeichernLaden_HF;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,IniFiles,Grids;
type TF_SpeichernLaden_HF = class(TForm) procedure Laden; private public end;
var F_SpeichernLaden_HF: TF_SpeichernLaden_HF;
implementation
{$R *.dfm}
uses U_Rotationskoerper_HF;
function IniPfad:string; begin result:=extractFilepath(paramstr(0))+'MyIni.ini'; end;
function HoleDateiPfad:string; var MyIniFile:TIniFile; begin MyIniFile:=TIniFile.Create(Inipfad); try result:=MyIniFile.ReadString('Test1','Test2','Test3'); finally MyIniFile.Free end; end;
procedure SchreibeDateiPfad(pfad:string); var MyIniFile:TIniFile; begin MyIniFile:=TIniFile.Create(Inipfad); try MyIniFile.WriteString('Test1','Test2',pfad); finally MyIniFile.Free end; end;
procedure Laden(Tabelle:TStringGrid;OpenDialog1:TOpenDialog); var sl:TStringlist; x,y,z:integer;
begin with OpenDialog1 do begin title:='Laden der Daten'; Initialdir:=extractFilepath(holedateipfad); filename:=extractFilename(holedateipfad); options:=[ofFileMustExist,ofAllowMultiselect,OfHideReadOnly,ofShareAware, ofEnableSizing,ofNoTestFileCreate,ofNoValidate]; Filter:='Textdateien(*.txt)|*.TXT|'+'Alle Dateien (*.*)|*.*'; DefaultExt:=''; if Execute then begin Tabelle.Cells[x,y]:=Sl.strings[z]; inc(z); SchreibeDateiPfad(Opendialog1.Filename); end else showmessage('Abbruch!'); end; end; end. |
Moderiert von raziel: Code- durch Delphi-Tags ersetzt.
|
|
Fabian W.
      
Beiträge: 1766
Win 7
D7 PE
|
Verfasst: So 15.05.05 14:28
Probiers mal so:
Delphi-Quelltext 1:
| U_SpeichernLaden_HF.Laden |
|
|
WeBsPaCe
      
Beiträge: 2322
Erhaltene Danke: 1
FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
|
Verfasst: So 15.05.05 14:32
@Fabi:
Da fehlt noch was...
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37:
| unit U_Rotationskoerper_HF;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, StdCtrls, Grids, ExtCtrls, math, ComCtrls, Buttons,Printers, ImgList,IniFiles,U_SpeichernLaden_HF; type TF_Rotationskoerper_HF = class(TForm) BOeffnen: TButton; BSichern: TButton; PrintDialog1: TPrintDialog; OpenDialog1: TOpenDialog; SaveDialog1: TSaveDialog; procedure BOeffnenClick(Sender: TObject);
private public end;
var F_Rotationskoerper_HF: TF_Rotationskoerper_HF;
implementation
uses U_SpeichernLaden_HF;
{$R *.dfm} {$R Bilder.RES}
procedure TF_Rotationskoerper_HF.BOeffnenClick(Sender: TObject); begin U_SpeichernLaden_HF.Laden; end; |
|
|
Fabian W.
      
Beiträge: 1766
Win 7
D7 PE
|
Verfasst: So 15.05.05 14:35
Da hätte er doch dann ne Meldung bekommen, ob er s in die Ususklausel setzten will?
Auf jeden Fall war ich der Meinung und hab's deshaln nicht dazugeschrieben.
|
|
WeBsPaCe
      
Beiträge: 2322
Erhaltene Danke: 1
FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
|
Verfasst: So 15.05.05 14:35
Fabian W. hat folgendes geschrieben: | Da hätte er doch dann ne Meldung bekommen, ob er s in die Ususklausel setzten will?
Auf jeden Fall war ich der Meinung und hab's deshaln nicht dazugeschrieben. |
Stimmt. Hast recht. 
|
|
ash25 
Hält's aus hier
Beiträge: 13
Delphi 7 Personal
|
Verfasst: So 15.05.05 14:52
Hey!
Danke für eure Antworten. Der Vorschlag von webspace funktioniert nicht, wie er auch selbst schon geschrieben hat, da dann der Bezeichner redifiniert wird.
Wenn ich das richtig verstanden habe, ist Fabian's Vorschlag der Unit einen anderen Namen zu geben oder? Hab ich zwar auch gemacht, gibt aber logischerweise ne Fehlermeldung da die Datei anders heißt und seh den Sinn auch nicht  Oder an welcher Stelle sollte das stehen?
|
|
Fabian W.
      
Beiträge: 1766
Win 7
D7 PE
|
Verfasst: So 15.05.05 14:55
Da wo du die Procedu Laden mit Laden aufrufst soll stehen: U_SpeichernLaden_HF.Laden
|
|
ash25 
Hält's aus hier
Beiträge: 13
Delphi 7 Personal
|
Verfasst: So 15.05.05 15:21
Hab ich soeben ausprobiert. Es heißt immer noch Undefinierter Bezeichner 'Laden'
Da ist irgendwo sicher so kleiner Schusselfehler drin 
|
|
Fabian W.
      
Beiträge: 1766
Win 7
D7 PE
|
Verfasst: So 15.05.05 15:28
|
|
delfiphan
      
Beiträge: 2684
Erhaltene Danke: 32
|
Verfasst: So 15.05.05 15:45
Ich bezweifle mal, dass deine zweite Unit überhaupt kompiliert (?)
Laden ist doch eine globale Funktion, die musst du in der interface-Section der Unit deklarieren, sonst kann man die von aussen nicht sehen.
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10:
| unit ...; interface ... procedure Laden; implementation procedure Laden; begin ... end; end. |
Zuletzt bearbeitet von delfiphan am So 15.05.05 15:47, insgesamt 1-mal bearbeitet
|
|
ash25 
Hält's aus hier
Beiträge: 13
Delphi 7 Personal
|
Verfasst: So 15.05.05 15:47
Hat nichts gebracht.  Außer dass jetzt so gut wie alles ein undefinierter Bezeichner ist.
Sag mal, ist das normalerweise auch so kompliziert oder liegt das an meiner Vorstellung wie das Programm laufen soll? Dachte eigentlich dass man die Units sich gegenseitig bekannt macht und man dann in jeder Unit mit den Prozeduren der anderen arbeiten kann.
|
|
Fabian W.
      
Beiträge: 1766
Win 7
D7 PE
|
Verfasst: So 15.05.05 15:49
Ich mach das auch immer so, und es geht...
|
|
Fabian W.
      
Beiträge: 1766
Win 7
D7 PE
|
Verfasst: So 15.05.05 15:51
Is bei mir net anders, wenn's mal klappert dann richtig. ZB: Funzt ne Zeile Code die im einen Prog funzt i meinem Jetzigen net...
|
|
WeBsPaCe
      
Beiträge: 2322
Erhaltene Danke: 1
FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
|
Verfasst: So 15.05.05 15:53
Ladt einfach mal schnell deinen Code hoch.  Dann können wir das schnell verbessern. Ist immer einfacher, den ganzen Code in Delphi zu öffnen. 
|
|
delfiphan
      
Beiträge: 2684
Erhaltene Danke: 32
|
Verfasst: So 15.05.05 15:57
Nein, das ganze funktioniert auch und ist nicht schwer, wenn man's richtig macht.
Kleines Beispiel (ungetestet):
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10:
| unit HilfsUnit; interface procedure ClickSecondButton; implementation uses HauptUnit; procedure ClickSecondButton; begin HauptForm.Button2.Click; end; end. |
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27:
| unit HauptUnit; interface ... type THauptForm = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); end;
var HauptForm: THauptForm; implementation uses HilfsUnit; ... procedure THauptForm.Button1Click(Sender: TObject); begin ClickSecondButton; end;
procedure THauptForm.Button2Click(Sender: TObject); begin ShowMessage('Button2 geklickt!'); end;
end. |
//Edit: Units getestet und korrigiert
Zuletzt bearbeitet von delfiphan am So 15.05.05 16:18, insgesamt 2-mal bearbeitet
|
|
Fabian W.
      
Beiträge: 1766
Win 7
D7 PE
|
Verfasst: So 15.05.05 16:00
Gewusst wie 
|
|
ash25 
Hält's aus hier
Beiträge: 13
Delphi 7 Personal
|
Verfasst: So 15.05.05 16:02
Hab den Tip von delfiphan ausprobiert und zwar so:
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:
| unit U_SpeichernLaden_HF;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,IniFiles,Grids;
type TF_SpeichernLaden_HF = class(TForm) procedure Laden; private public end; |
In der Hauptunit steht dasselbe wie ich an Code im Eröffnungspost geschrieben hab. Fehlermeldung ist auch die gleiche. Kommentier ich den Aufruf der Prozedur Laden beim ButtonClick Ereigniss weg, so erhalte ich eine Fehlermeldung im interface Teil und zwar in der neu geschrieben Zeile: Ungenügend Forward- oder External-Deklaration: 'TF_SpeichernLaden_HF.Laden'
Moderiert von Christian S.: Code- durch Delphi-Tags ersetzt.
|
|
delfiphan
      
Beiträge: 2684
Erhaltene Danke: 32
|
Verfasst: So 15.05.05 16:07
@ash25:
Wofür brauchst du das TF_SpeichernLaden_HF? Was du brauchst ist eine "nackte" Unit ohne Form. Aber egal:
 Zeile 11 gehört auf Zeile 8.
PS: Wahrscheinlich ist es wirklich einfacher, wenn du das gesamte Projekt mal postest.
|
|
ash25 
Hält's aus hier
Beiträge: 13
Delphi 7 Personal
|
Verfasst: So 15.05.05 16:28
Die "nackte" Unit dient nur der Übersichtlichkeit. Möchte die Hauptunit quasi ein bißchen "entrümpeln" und hab mir gedacht dass dies mit einer zusätzlichen bzw mehreren Units gehen müsste und ich in der Hauptunit nur noch die entsprechenden Prozeduren der Units aufrufe.
Oke, jetzt mal das gesamte Projekt. Nicht erschrecken, sind sicher noch einige Sachen drin die man verbessern könnte, aber für mich reichts erstmal.
Aus der Hauptunit ausgliedern möchte ich evtl auch noch die Prozedur Drucken und herausfinden warum bzw wie ich die Bilder beim Mouseover aus der eingebunden Bilder.res laden kann. Die Befehle die drin stehen sind zumindest so nicht brauchbar.
Die Hauptunit
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421:
| unit U_Rotationskoerper_HF;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, StdCtrls, Grids, ExtCtrls, math, ComCtrls, Buttons,Printers, ImgList,IniFiles,U_SpeichernLaden_HF;
type TF_Rotationskoerper_HF = class(TForm) Berechnen: TButton; Beenden: TButton; lblSx: TLabel; lblSy: TLabel; edtSx: TEdit; edtSy: TEdit; Tabelle: TStringGrid; pnlAges: TPanel; Ages: TPanel; pnlXsGes: TPanel; Xsges: TPanel; pnlYsGes: TPanel; Ysges: TPanel; pnlVx: TPanel; Vx: TPanel; pnlVy: TPanel; Vy: TPanel; pnlEingabedaten: TPanel; pnlAusgabedaten: TPanel; Label1: TLabel; Label2: TLabel; pnlArtRechteck: TPanel; pnlArtDreieck: TPanel; pnlArtKreis: TPanel; pnlArtKreissektor: TPanel; pnlArtKreisabschnitt: TPanel; pnlArtR: TPanel; pnlArtD: TPanel; pnlArtK: TPanel; pnlArtS: TPanel; pnlArtA: TPanel; pnlArt: TPanel; Zeichnung: TImage; imgRechteck: TImage; imgDreieck: TImage; imgKreis: TImage; imgKreissektor: TImage; imgKreisabschnitt: TImage; Drucken: TButton; ImageList1: TImageList; BOeffnen: TButton; BSichern: TButton; PrintDialog1: TPrintDialog; OpenDialog1: TOpenDialog; SaveDialog1: TSaveDialog;
procedure FormCreate(Sender: TObject); procedure BeendenClick(Sender: TObject); procedure BerechnenClick(Sender: TObject); procedure imgRechteckMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure imgDreieckMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure imgKreisMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure imgKreissektorMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure imgKreisabschnittMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure DruckenClick(Sender: TObject); procedure TabelleSelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean); procedure BOeffnenClick(Sender: TObject); private public end;
var F_Rotationskoerper_HF: TF_Rotationskoerper_HF; implementation
{$R *.dfm} {$R Bilder.RES} {$R Bilder2.Res}
procedure TF_Rotationskoerper_HF.FormCreate(Sender: TObject);
var i,j:integer;
begin Tabelle.Cells[0,1] :='1'; Tabelle.Cells[0,2] :='2'; Tabelle.Cells[0,3] :='3'; Tabelle.Cells[0,4] :='4'; Tabelle.Cells[0,5] :='5'; Tabelle.Cells[0,6] :='6'; Tabelle.Cells[0,7] :='7'; Tabelle.Cells[0,0] :='Lfd.Nr.'; Tabelle.Cells[1,0] :='Art'; Tabelle.Cells[2,0] :='Vorz.'; Tabelle.Cells[3,0] :='Maß 1 [mm]'; Tabelle.Cells[4,0] :='Maß 2 [mm]'; Tabelle.Cells[5,0] :='Lx [mm]'; Tabelle.Cells[6,0] :='Ly [mm]'; Tabelle.Cells[7,0] :='Xs [mm]'; Tabelle.Cells[8,0] :='Ys [mm]'; Tabelle.Cells[9,0] :='Fläche [mm²]';
Tabelle.Colwidths[0] :=42; Tabelle.Colwidths[1] :=30; Tabelle.Colwidths[2] :=33; Tabelle.ColWidths[3] :=75; Tabelle.ColWidths[4] :=75; Tabelle.Colwidths[9] :=82; for i:=2 to 6 do begin for j:=1 to 6 do begin Tabelle.Cells[i,j] :=IntToStr(0); end; end; for i:=7 to 9 do begin for j:=1 to 6 do begin Tabelle.Cells[i,j] :=IntToStr(0); end; end; for i:=1 to 1 do begin for j:=1 to 6 do begin Tabelle.Cells[i,j] :='R'; end; end; for i:=2 to 2 do begin for j:=1 to 6 do begin Tabelle.Cells[i,j] :='+'; end; end; end;
procedure TF_Rotationskoerper_HF.BeendenClick(Sender: TObject); begin application.terminate; end;
procedure TF_Rotationskoerper_HF.BerechnenClick(Sender: TObject);
type Art = array[1..6] of char; Vorz = array[1..6] of integer; Mass1 = array[1..6] of single; Mass2 = array[1..6] of single; Lx = array[1..6] of single; Ly = array[1..6] of single; Sx = array[1..6] of single; Sy = array[1..6] of single; Flaeche = array[1..6] of single; var vArt:Art; vVorz:Vorz; vMass1:Mass1; vMass2:Mass2; vLx:Lx; vLy:Ly; vSx:Sx; vSy:Sy; vFlaeche:Flaeche; vFlaecheGes,b_wert,s_wert,h_wert,vXsGes,vYsGes:single; i,j:integer;
begin vFlaecheGes:=0; for i := 1 to 6 do begin vArt[i] :=upCase(Tabelle.Cells[1,i][1]); vMass1[i] :=StrToInt(Tabelle.Cells[3,i]); vMass2[i] :=StrToInt(Tabelle.Cells[4,i]); vLx[i] :=StrToInt(Tabelle.Cells[5,i]); vLy[i] :=StrToInt(Tabelle.Cells[6,i]);
for j:=1 to 6 do case Tabelle.Cells[2,i][1] of '+': begin vVorz[i]:=1; end; '-': begin vVorz[i]:=-1; end; end; case vArt[i] of 'R': begin vSx[i]:=vLx[i] + vMass1[i]/2; vSy[i]:=vLy[i] + vMass2[i]/2; vFlaeche[i]:=vVorz[i]*vMass1[i]*vMass2[i]; end; 'D': begin vSx[i]:=vLx[i] + vMass1[i]/3; vSy[i]:=vLy[i] + vMass2[i]/3; vFlaeche[i]:=vVorz[i]*(vMass1[i]*vMass2[i])/2; end; 'K': begin vSx[i]:=vLx[i]; vSy[i]:=vLy[i]; vFlaeche[i]:=vVorz[i]*pi*sqr(vMass1[i]); Tabelle.Cells[4,i]:='---'; end; 'S': begin b_wert:=2*pi*vMass1[i]*(vMass2[i]/360); s_wert:=2*vMass1[i]*sin(vMass2[i]/2); vSx[i]:=vLx[i]; vSy[i]:=(2/3)*(vMass1[i]*s_wert)/b_wert; vFlaeche[i]:=vVorz[i]*pi*sqr(vMass1[i])*(vMass2[i]/360); end; 'A': begin b_wert:=2*pi*vMass1[i]*(vMass2[i]/360); s_wert:=2*vMass1[i]*sin(vMass2[i]/2); h_wert:=2*vMass1[i]*sqr(sin(vMass2[i]/4)); vFlaeche[i]:=vVorz[i]*(vMass1[i]*(b_wert-s_wert)+(s_wert*h_wert))/2; vSx[i]:=vLx[i]; vSy[i]:=(1*power(s_wert,3))/(12*vFlaeche[i]); end;
end; vFlaecheGes:=vFlaecheGes + vFlaeche[i]; vXsges:=((vSx[i]*vFlaeche[i])/vFlaecheGes)+vLx[i]; vYsges:=((vSy[i]*vFlaeche[i])/vFlaecheGes)+vLx[i]; Ages.Caption:=FloatToStrF(vFlaecheges,fffixed,7,2); XsGes.Caption:=FloatToStrF(vXsges,fffixed,7,2); YsGes.Caption:=FloatToStrF(vYsges,fffixed,7,2); Tabelle.Cells[7,i] := FloatToStrF(vSx[i],fffixed,7,2); Tabelle.Cells[8,i] := FloatToStrF(vSy[i],fffixed,7,2); Tabelle.Cells[9,i] := FloatToStrF(vFlaeche[i],fffixed,7,2); end; end;
procedure TF_Rotationskoerper_HF.imgRechteckMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin Zeichnung.Show; Zeichnung.Picture.Bitmap.LoadFromFile('1'); end;
procedure TF_Rotationskoerper_HF.imgDreieckMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin Zeichnung.Show; Zeichnung.Picture.LoadFromFile('Dreieck.bmp'); end;
procedure TF_Rotationskoerper_HF.imgKreisMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin Zeichnung.Show; Zeichnung.Picture.LoadFromFile('Kreis.bmp'); end;
procedure TF_Rotationskoerper_HF.imgKreissektorMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin Zeichnung.Show; Zeichnung.Picture.LoadFromFile('Kreissektor.bmp'); end;
procedure TF_Rotationskoerper_HF.imgKreisabschnittMouseMove( Sender: TObject; Shift: TShiftState; X, Y: Integer); begin Zeichnung.Show; Zeichnung.Picture.LoadFromFile('Kreisabschnitt.bmp'); end;
procedure TF_Rotationskoerper_HF.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin Zeichnung.Hide; end;
procedure TF_Rotationskoerper_HF.DruckenClick(Sender: TObject);
Var x,y,li,ob,re,un,waag,senk,h,a,scal,links,oben:integer; s:string;
function rech(i,j:integer):integer; begin result:=round(((i*j)/72)*scal); end;
begin scal:=1; links:=150; oben:=150; if PrintDialog1.Execute then begin Printer.Orientation:=poLandscape; Waag:=GetDeviceCaps(Printer.Handle, LOGPIXELSX); Senk:=GetDeviceCaps(Printer.Handle, LOGPIXELSY); links:=rech(links,waag); oben:=rech(oben,senk); a:=rech(3,waag); li:=GetDeviceCaps(Printer.handle, PHYSICALOFFSETX)+1+links; with Printer do begin Printer.BeginDoc; s:='Tabellenausdruck'; Title:=s; Canvas.Font.Name:='Ms Sans Serif'; Canvas.Font.Style:=[fsbold,fsunderline]; Canvas.Font.Size:=18; Canvas.TextOut(rech(180,waag),rech(20,senk),'Schwerpunkts-, Flächen- und Rotationsvolumenberechnung'); Canvas.TextOut(rech(300,waag),rech(55,senk),'von zusammengesetzten Flächen'); Canvas.Font:=Tabelle.Font; Canvas.Font.Size:=round((Tabelle.Font.Size/0.72)*scal); h:=Canvas.TextHeight(s); Canvas.Pen.Color:=$333333; for x:=0 to Tabelle.ColCount-1 do begin if Tabelle.GridLineWidth > 0 then begin Canvas.Pen.Style:=pssolid; Canvas.Pen.Width:=1; end else Canvas.Pen.Style:=psclear; ob:=GetDeviceCaps(Printer.Handle, PHYSICALOFFSETY)+1+oben; re:=li+rech(Tabelle.ColWidths[x]+1,Waag); for y:=0 to Tabelle.RowCount-1 do begin un:=ob+rech(Tabelle.RowHeights[y]+1,senk); if (x < Tabelle.FixedCols) or (y < Tabelle.FixedRows) then Canvas.Brush.Color:=Tabelle.FixedColor else Canvas.Brush.Color:=Tabelle.Color; Canvas.Rectangle(li,ob,re,un); Canvas.Brush.Style:=bsclear; Canvas.Textrect(rect(li+a,ob+1,re-a,un-1), li+a,ob+(un-ob-h)div 2,Tabelle.Cells[x,y]); ob:=un; end; li:=re;
end; Canvas.Font.Name:='Ms Sans Serif'; Canvas.Font.Style:=[fsbold]; Canvas.Font.Size:=14; Canvas.TextOut(rech(160,waag),rech(350,senk),lblSx.Caption); Canvas.TextOut(rech(400,waag),rech(350,senk),edtSx.Text); Canvas.TextOut(rech(160,waag),rech(370,senk),lblSy.Caption); Canvas.TextOut(rech(400,waag),rech(370,senk),edtSy.Text);
Canvas.TextOut(rech(150,waag),rech(400,senk),pnlAges.Caption); Canvas.TextOut(rech(400,waag),rech(400,senk),Ages.Caption); Canvas.TextOut(rech(150,waag),rech(420,senk),pnlXsGes.Caption); Canvas.TextOut(rech(400,waag),rech(420,senk),XsGes.Caption); Canvas.TextOut(rech(150,waag),rech(440,senk),pnlYsGes.Caption); Canvas.TextOut(rech(400,waag),rech(440,senk),YsGes.Caption); Canvas.TextOut(rech(150,waag),rech(460,senk),pnlVx.Caption); Canvas.TextOut(rech(400,waag),rech(460,senk),Vx.Caption); Canvas.TextOut(rech(150,waag),rech(480,senk),pnlVy.Caption); Canvas.TextOut(rech(400,waag),rech(480,senk),Vy.Caption);
Printer.EndDoc; end; end; end; procedure TF_Rotationskoerper_HF.TabelleSelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean);
begin if ACol in [7..9] then Tabelle.Options:=Tabelle.Options - [goEditing] else Tabelle.Options:=Tabelle.Options + [goEditing]; end;
procedure TF_Rotationskoerper_HF.BOeffnenClick(Sender: TObject); begin Laden; end; end. |
Und hier die "nackte" Unit SpeichernLaden. Wie gesagt ob das Laden bzw Speichern mittels StringGrid so klappt ist noch fraglich.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74:
| unit U_SpeichernLaden_HF;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,IniFiles,Grids; procedure Laden; type TF_SpeichernLaden_HF = class(TForm)
private public end;
var F_SpeichernLaden_HF: TF_SpeichernLaden_HF;
implementation
{$R *.dfm}
uses U_Rotationskoerper_HF;
function IniPfad:string; begin result:=extractFilepath(paramstr(0))+'MyIni.ini'; end;
function HoleDateiPfad:string; var MyIniFile:TIniFile; begin MyIniFile:=TIniFile.Create(Inipfad); try result:=MyIniFile.ReadString('Test1','Test2','Test3'); finally MyIniFile.Free end; end;
procedure SchreibeDateiPfad(pfad:string); var MyIniFile:TIniFile; begin MyIniFile:=TIniFile.Create(Inipfad); try MyIniFile.WriteString('Test1','Test2',pfad); finally MyIniFile.Free end; end;
procedure Laden(Tabelle:TStringGrid;OpenDialog1:TOpenDialog); var sl:TStringlist; x,y,z:integer;
begin with OpenDialog1 do begin title:='Laden der Daten'; Initialdir:=extractFilepath(holedateipfad); filename:=extractFilename(holedateipfad); options:=[ofFileMustExist,ofAllowMultiselect,OfHideReadOnly,ofShareAware, ofEnableSizing,ofNoTestFileCreate,ofNoValidate]; Filter:='Textdateien(*.txt)|*.TXT|'+'Alle Dateien (*.*)|*.*'; DefaultExt:=''; if Execute then begin Tabelle.Cells[x,y]:=Sl.strings[z]; inc(z); SchreibeDateiPfad(Opendialog1.Filename); end else showmessage('Abbruch!'); end; end; end. |
Edit: Die Dazugehörigen DFM-Dateien.
Hauptunit:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470: 471: 472: 473: 474: 475: 476: 477: 478: 479: 480: 481: 482: 483: 484: 485: 486: 487: 488: 489: 490: 491: 492: 493: 494: 495: 496: 497: 498: 499: 500: 501: 502: 503: 504: 505: 506: 507: 508: 509: 510: 511: 512: 513: 514: 515: 516: 517: 518: 519: 520: 521: 522: 523: 524: 525: 526: 527: 528: 529: 530: 531: 532: 533: 534: 535: 536: 537: 538: 539: 540: 541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551: 552: 553: 554: 555: 556: 557: 558: 559: 560: 561: 562: 563: 564: 565: 566: 567: 568: 569: 570: 571: 572: 573: 574: 575: 576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595: 596: 597: 598: 599: 600: 601: 602: 603: 604: 605: 606: 607: 608: 609: 610: 611: 612: 613: 614: 615: 616: 617: 618: 619: 620: 621: 622: 623: 624: 625: 626: 627: 628: 629: 630: 631: 632: 633: 634: 635: 636: 637: 638: 639: 640: 641: 642: 643: 644: 645: 646: 647: 648: 649: 650: 651: 652: 653: 654: 655: 656: 657: 658: 659: 660: 661: 662: 663: 664: 665: 666: 667: 668: 669: 670: 671: 672: 673: 674: 675: 676: 677: 678: 679: 680: 681: 682: 683: 684: 685: 686: 687: 688: 689: 690: 691: 692: 693: 694: 695: 696: 697: 698: 699: 700: 701: 702: 703: 704: 705: 706: 707: 708: 709: 710: 711: 712: 713: 714: 715: 716: 717: 718: 719: 720: 721: 722: 723: 724: 725: 726: 727: 728: 729: 730: 731: 732: 733: 734: 735: 736: 737: 738: 739: 740: 741: 742: 743: 744: 745: 746: 747: 748: 749: 750: 751: 752: 753: 754: 755: 756: 757: 758: 759: 760: 761: 762: 763: 764: 765: 766: 767: 768: 769: 770: 771: 772: 773: 774: 775: 776: 777: 778: 779: 780: 781: 782: 783: 784: 785: 786: 787: 788: 789: 790: 791: 792: 793: 794: 795: 796: 797: 798: 799: 800: 801: 802: 803: 804: 805: 806:
| object F_Rotationskoerper_HF: TF_Rotationskoerper_HF Left = 179 Top = 164 Width = 845 Height = 501 Caption = 'F_Rotationsk'#246'rper_HF' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -16 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False Position = poDesktopCenter OnCreate = FormCreate OnMouseMove = FormMouseMove PixelsPerInch = 96 TextHeight = 20 object lblSx: TLabel Left = 208 Top = 312 Width = 171 Height = 16 Caption = 'Abstand Sx von der y-Achse:' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False end object lblSy: TLabel Left = 208 Top = 344 Width = 171 Height = 16 Caption = 'Abstand Sy von der x-Achse:' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False end object Label1: TLabel Left = 160 Top = 16 Width = 562 Height = 24 Alignment = taCenter Caption = 'Schwerpunkts-, Fl'#228'chen- und Rotationsvolumenberechnung' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -19 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentFont = False end object Label2: TLabel Left = 280 Top = 48 Width = 314 Height = 24 Alignment = taCenter Caption = 'von zusammengesetzten Fl'#228'chen' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -19 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentFont = False end object Zeichnung: TImage Left = 8 Top = 304 Width = 161 Height = 121 Cursor = crDrag AutoSize = True Center = True Proportional = True Transparent = True end object imgRechteck: TImage Left = 144 Top = 160 Width = 25 Height = 25 ParentShowHint = False Picture.Data = ShowHint = False Transparent = True OnMouseMove = imgRechteckMouseMove end object imgDreieck: TImage Left = 144 Top = 184 Width = 25 Height = 25 Picture.Data = Transparent = True OnMouseMove = imgDreieckMouseMove end object imgKreis: TImage Left = 144 Top = 208 Width = 25 Height = 25 Picture.Data = Transparent = True OnMouseMove = imgKreisMouseMove end object imgKreissektor: TImage Left = 144 Top = 232 Width = 25 Height = 25 Picture.Data = Transparent = True OnMouseMove = imgKreissektorMouseMove end object imgKreisabschnitt: TImage Left = 144 Top = 256 Width = 25 Height = 25 Picture.Data = Transparent = True OnMouseMove = imgKreisabschnittMouseMove end object Berechnen: TButton Left = 224 Top = 392 Width = 121 Height = 33 Caption = 'Berechnen' TabOrder = 3 OnClick = BerechnenClick end object Beenden: TButton Left = 376 Top = 392 Width = 121 Height = 33 Caption = 'Beenden' TabOrder = 4 OnClick = BeendenClick end object edtSx: TEdit Left = 392 Top = 312 Width = 105 Height = 28 TabOrder = 1 end object edtSy: TEdit Left = 392 Top = 344 Width = 105 Height = 28 TabOrder = 2 end object Tabelle: TStringGrid Left = 208 Top = 120 Width = 609 Height = 178 ColCount = 10 FixedCols = 0 RowCount = 7 Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goTabs] ParentFont = False ScrollBars = ssNone TabOrder = 0 OnSelectCell = TabelleSelectCell end object pnlAges: TPanel Left = 520 Top = 312 Width = 209 Height = 25 Alignment = taLeftJustify Caption = ' Gesamter Fl'#228'cheninhalt' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 5 end object Ages: TPanel Left = 728 Top = 312 Width = 81 Height = 25 Alignment = taRightJustify Caption = '0.00' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 6 end object pnlXsGes: TPanel Left = 520 Top = 336 Width = 209 Height = 25 Alignment = taLeftJustify Caption = ' Schwerpunktskoordinate Xsges' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 7 end object Xsges: TPanel Left = 728 Top = 336 Width = 81 Height = 25 Alignment = taRightJustify Caption = '0.00' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 8 end object pnlYsGes: TPanel Left = 520 Top = 360 Width = 209 Height = 25 Alignment = taLeftJustify Caption = ' Schwerpunktskoordinate Ysges' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 9 end object Ysges: TPanel Left = 728 Top = 360 Width = 81 Height = 25 Alignment = taRightJustify Caption = '0.00' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 10 end object pnlVx: TPanel Left = 520 Top = 384 Width = 209 Height = 25 Alignment = taLeftJustify Caption = ' Rotationsvolumen Vx' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 11 end object Vx: TPanel Left = 728 Top = 384 Width = 81 Height = 25 Alignment = taRightJustify Caption = '0.000 dm'#179 Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 12 end object pnlVy: TPanel Left = 520 Top = 408 Width = 209 Height = 25 Alignment = taLeftJustify Caption = ' Rotationsvolumen Vy' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 13 end object Vy: TPanel Left = 728 Top = 408 Width = 81 Height = 25 Alignment = taRightJustify Caption = '0.000 dm'#179 Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 14 end object pnlEingabedaten: TPanel Left = 208 Top = 96 Width = 393 Height = 25 Caption = 'Eingabedaten' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentFont = False TabOrder = 15 end object pnlAusgabedaten: TPanel Left = 600 Top = 96 Width = 217 Height = 25 Caption = 'ber. Daten bzgl. Hauptsystem' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentFont = False TabOrder = 16 end object pnlArtRechteck: TPanel Left = 8 Top = 160 Width = 105 Height = 25 Caption = 'Rechteck' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 17 end object pnlArtDreieck: TPanel Left = 8 Top = 184 Width = 105 Height = 25 Caption = 'rechtw. Dreieck' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 18 end object pnlArtKreis: TPanel Left = 8 Top = 208 Width = 105 Height = 25 Caption = 'Kreis' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 19 end object pnlArtKreissektor: TPanel Left = 8 Top = 232 Width = 105 Height = 25 Caption = 'Kreissektor' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 20 end object pnlArtKreisabschnitt: TPanel Left = 8 Top = 256 Width = 105 Height = 25 Caption = 'Kreisabschnitt' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 21 end object pnlArtR: TPanel Left = 112 Top = 160 Width = 25 Height = 25 Caption = 'R' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 22 end object pnlArtD: TPanel Left = 112 Top = 184 Width = 25 Height = 25 Caption = 'D' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 23 end object pnlArtK: TPanel Left = 112 Top = 208 Width = 25 Height = 25 Caption = 'K' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 24 end object pnlArtS: TPanel Left = 112 Top = 232 Width = 25 Height = 25 Caption = 'S' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 25 end object pnlArtA: TPanel Left = 112 Top = 256 Width = 25 Height = 25 Caption = 'A' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 26 end object pnlArt: TPanel Left = 8 Top = 128 Width = 129 Height = 25 Caption = 'Art der Fl'#228'che' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 27 end object Drucken: TButton Left = 120 Top = 48 Width = 89 Height = 25 Caption = 'Drucken' TabOrder = 28 OnClick = DruckenClick end object BOeffnen: TButton Left = 16 Top = 48 Width = 89 Height = 25 Caption = 'Laden' TabOrder = 29 OnClick = BOeffnenClick end object BSichern: TButton Left = 16 Top = 88 Width = 89 Height = 25 Caption = 'Speichern' TabOrder = 30 end object ImageList1: TImageList Left = 32 Bitmap = end object PrintDialog1: TPrintDialog end object OpenDialog1: TOpenDialog Left = 64 end object SaveDialog1: TSaveDialog Left = 96 end end |
Und die der zweiten Unit:
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:
| object F_SpeichernLaden_HF: TF_SpeichernLaden_HF Left = 474 Top = 191 Width = 405 Height = 290 Caption = 'F_SpeichernLaden_HF' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 end |
Moderiert von raziel: Code- durch Delphi-Tags ersetzt.
Zuletzt bearbeitet von ash25 am So 15.05.05 17:03, insgesamt 1-mal bearbeitet
|
|
delfiphan
      
Beiträge: 2684
Erhaltene Danke: 32
|
Verfasst: So 15.05.05 16:51
Mit einer "nackten Unit" meinte ich eine Unit ohne Formular. Deine zweite Unit hat ja immer noch ein leeres Formular. Wie dem auch sei.
Du musst schon das gesamte Projekt posten, sonst lässt es sich nicht kompilieren. Der Source-Code alleine reicht noch nicht. Könntest du noch die DFM-Dateien posten?
Das eigentliche Problem ist ja, dass Delphi keine Dateiunabhängigen Namespaces unterstützt. Das ist auch einer der Kritikpunkte von Delphi. Wenn dir das mit den Units zu kompliziert ist, kannst du auch Teile des Sourcecodes includen mit {$include datei}.
|
|
Dieses Thema ist gesperrt, Du kannst keine Beiträge editieren oder beantworten.
Das Thema wurde von einem Team-Mitglied geschlossen. Wenn du mit der Schließung des Themas nicht einverstanden bist, kontaktiere bitte das Team.
|
|