Howto Use TSaveDialog/fi: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | ## Kuinka käytetään tallenna-dialogia | |
| 2 | 2 | ||
| 3 | - | ||
| 3 | + | [](</File:tsavedialog.png>) | |
| 4 | 4 | ||
| 5 | - | ||
| 5 | + | Yksinkertainen opastus: | |
| 6 | 6 | ||
| 7 | - | ||
| 8 | - | ||
| 9 | - | ||
| 10 | - | ||
| 11 | - | ||
| 7 | + | 1. Laita [SaveDialog-komponentti](</index.php?title=TSaveDialog/fi&action=edit&redlink=1> "TSaveDialog/fi \(page does not exist\)") [](</File:tsavedialog.png>) [[TForm/fi|lomakkeelle eli Form:lle]] (Mihin tahansa paikkaan. Se ei ole varsinaisessa ohjelmassa näkyvissä). | |
| 8 | + | [](</File:Component_Palette_Dialogs.png>) | |
| 9 | + | (Se on toinen vasemmalta [[Dialogs tab/fi|dialogs välilehdellä]]) | |
| 10 | + | 2. Lisää [[TMemo/fi|memo- eli muistiokomponentti]] [](</File:tmemo.png>) lomakkeelle. | |
| 11 | + | 3. Lisää [[TButton/fi|Button- eli painonappikomponentti]] [](</File:tbutton.png>) lomakkeelle. | |
| 12 | 12 | ||
| 13 | - | ||
| 13 | + | ||
| 14 | 14 | ||
| 15 | - | ||
| 15 | + | [[IDE Window: Object Inspector/fi|Komponenttimuokkain]] näyttää Button1 olion (komponentin) ominaisuudet. Muuta [[Property/fi|ominaisuutta]] jota kutsutaan nimellä Caption. Se näyttää arvoa 'Button1'. Vaihda se 'Tallenna' nimiseksi. | |
| 16 | 16 | ||
| 17 | - | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - | ||
| 21 | - | ||
| 22 | - | ||
| 17 | + | Valitse komponenttimuokkaimen tapahtumat välilehti. Mene OnClick:n kohdalla oikealla puolella olevaan painikkeeseen joka on pieni laatikko kolmella pisteellä (...). Napsauttamalla tätä siirrytään automaattisesti tehtyyn koodirunkoon lähdekoodieditoriin. Täydennä koodi seuraavaksi: | |
| 23 | 18 | ``` | |
| 19 | + | procedure TForm1.Button1Click( Sender: TObject ); | |
| 20 | + | begin | |
| 21 | + | if SaveDialog1.Execute then | |
| 22 | + | Memo1.Lines.SaveToFile( SaveDialog1.Filename ); | |
| 23 | + | end; | |
| 24 | + | ``` | |
| 24 | 25 | ||
| 25 | - | ||
| 26 | + | [ Execute](<http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tcommondialog.execute.html> "doc:lcl/dialogs/tcommondialog.execute.html")-[metodi](</index.php?title=Method/fi&action=edit&redlink=1> "Method/fi \(page does not exist\)") näyttää tallenna dialogin. Se palauttaa joko arvon [true](</index.php?title=True/fi&action=edit&redlink=1> "True/fi \(page does not exist\)") kun ohjelman käyttäjä valitsee tiedoston tai arvon [false](</index.php?title=False/fi&action=edit&redlink=1> "False/fi \(page does not exist\)") jos käyttäjä keskeyttää valinnan. | |
| 26 | 27 | ||
| 27 | - | ||
| 28 | + | [ Filename](<http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tfiledialog.filename.html> "doc:lcl/dialogs/tfiledialog.filename.html") property palauttaa täyden tiedostonimen polkuineen. | |
| 28 | 29 | ||
| 30 | + | ||
| 31 | + | ||
| 29 | 32 | ## Katso myös | |
| 30 | 33 | ||
| 31 | - | ||
| 32 | - | ||
| 34 | + | * [[Howto Use TOpenDialog/fi|Kuinka käytetään tiedoston avaus dialogia]] | |
| 35 | + | * [[CopyFile/fi|Tiedoston kopiointi]] | |
| 33 | 36 | ||
| 34 | 37 | --- | |
| 35 | - | ||
| 38 | + | *From the Free Pascal wiki, page "Howto Use TSaveDialog/fi", as the Internet Archive kept it on 2022-09-27. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
