Delphi Spin Edit With Real Life
Consultation of the Oracle. From The Oracle, by Biacca Camillo Miola, 1880. Digital image courtesy of the Getty’s Open Content Program A Quick IntroductionDelphi was perhaps the most important religious sanctuary of the ancient Greek world. This institution was so integral to life in the Mediterranean that it continued to function through the reign of Alexander the Great and into the Roman Empire. The prophecies given here play a large role, both in literature such as Sophocles’ Oedipus Rex and Aeschylus’ Orestea trilogy, and in daily life, especially during the Persian wars.This sanctuary is important to the study of women in antiquity as the famed oracle who resided in Delphi was a woman. Who was the Pythia, and why it is important that she continues to be a topic explored by classicists.
Orestes consulting the Oracle. Paestan red-figured bell-krater, ca 330 BC. From the British Museum; Accession number GR 1917.12-10.1. Former Hope Collection.Delphi was the site of the temple to Apollo, in which a female oracle sat on a tripod and gave prophecies. Both individuals and entire communities could seek Apollo’s advice at the temple. The temple only functioned nine months of the year, and prophecies were only given on the seventh day after each new moon (Connelly, 2007).
Literature tells us that the oracle was also responsible for performing purification rituals as well as giving prophecies. This is portrayed in Aeschylus’ Eumenides. In this play Orestes is purified by the oracle at Delphi in a vain attempt to be forgiven for murdering his mother, Clytemnestra. Orestes, in lines 280-282 of Eumenides says “the matricidal stain washed off, expelled while still fresh, at the hearth of holy Phoebus by pigs who died in purifying rites” (Aeschylus & Ruden, 2017 p.154). It can therefore be deduced that this purification ritual involved animal sacrifice.““the matricidal stain washed off, expelled while still fresh, at the hearth of holy Phoebus by pigs who died in purifying rites.”Joseph Eddy Fontenrose, in his book The Delphic Oracle, its Responses and Operations, catalogued the types of questions asked of the Pythia in reality and divided them into three categories: those relating to the gods, those relating to public matters, and those relating to domestic matters. It seems as though thirty percent of questions related to “cult foundations”, while about ten percent of questions related to “colony foundations” and “war” (Fontenrose, 1978, p.48).Though this statistic is interesting, we must ask ourselves why the data has been skewed this direction. We need to consider which groups of people were most likely consulting the Delphic oracle.In order to examine this data further, gender must be discussed in relation to the sanctuary at Delphi.
It is not known whether or not women were permitted to ask questions of the Oracle. If examining Delphi through the Athenian perspective, a woman’s kyrios, or guardian, would likely be sent to Delphi carrying her questions.
Euripides, in his work Ion, reinforces this belief when he tells of a chorus of Athenian maidservants seeking entry into the temple. The Chorus asks “is it lawful to walk into the sanctuary?” to which Ion answers “Strangers, it is not lawful” (Euripides & Oates & O’Neill, 1938, lines 219-221). A mere few lines later however, Ion tells the chorus “if you offer the honey cake before temple, and you wish to ask something of Phoebus, advance to the altar” (Euripides & Oates & O’Neill, 1938, lines 226-228) This could be a representation of ideology vs actual practice.
In all likelihood, these women were initially refused access to the oracle due to their sex. Euripides might be saying that theoretically women would not be allowed in the temple, yet women were granted access to the oracle if they made a rich offering. Unfortunately, as there is little evidence of women asking questions of the Pythia, this examination must be halted for now. Examining the Evidence: The site at Delphi.
The Temple of Apollo. By Helen Simonsson, 2012.The sanctuary of Apollo at Delphi was located on Mount Parnassus, in mainland Greece. Excavations of this site, headed by the French school, began in 1892(Lloyd-Jones, 1976, p.60). Pausanias tells of four temples toApollo. According to Pausanias the first temple was made of laurel branches and was constructed in the shape of a hut. The second temple was built by bees who used honey and bird feathers as construction materials.
The third temple was made entirely of bronze, this temple is said to have either melted in a fire or been swallowed by the earth. Finally, Pausanias’ fourth temple was built of stone by the legendary architects Trophonios and Agamedes (Sourvinou-Inwood, 1979, 231).
Site plan of the Sanctuary of Apollo in Delphi, Greece. By Tomisti, 2017.The mentioned theatre and stoa are labelled numbers 6 and 13 respectively.
The Temple of Athena Pronaia does not seem to be on this image, but it would be located around number 40.Archaeological remains suggest that Delphi was not a grand site in the Bronze age. During this period, it seems that the temple to Apollo was located closer to the temple of Athene Pronaia than it is today. The classical temple to Apollo, that we think of today, is located instead near the theatre and the west stoa- to the west of the original site. Furthermore, the scant archaeological evidence (a few clay tablets and a Minoan drinking vessel) suggests that the site was more for a private cult than a centre of the Greek world (Lloyd-Jones, 1976, p.60). It is believed that this Bronze Age version of the sanctuary at Delphi was burned down at the beginning of the dark ages along with many other sites, however evidence supporting this belief is minimal (Lloyd-Jones, 1976, p.60). This temple is likely the third one made of bronze, mentioned by Pausanias.
It is only during the subsequent Orientalizing period that Delphi began to rise as an important religious sanctuary.The exact date that the Oracle to Apollo at Delphi rose to popularity is unknown. Hesiod mentions “Holy Pytho” in his Theogony, stating that Zeus set the stone Kronos had swallowed in his stead “up on the high-ways of the earthy in holy Pytho under the slopes of Parnassus” Hesiod & Brown, 1986, pg. Hesiod’s mention of Pytho seems to indicate that an institution had been well established at Delphi during the 8 th Century BC, the period in which Hesiod composed his Theogony. Homer also discusses Pytho in the eighth book of The Odyssey, in which he describes Agamemnon “in sacred Pytho, when he passed over the threshold of stone to enquire of the oracle: (Homer & Murray, 1919, Book 8, lines 80-81). This is the first piece of literature that connects the site at Delphi with oracles and prophecy. However, literature is not always the most accurate, in order to properly date the rise of the sanctuary at Delphi, archaeological evidence must be examined in combination with the already reviewed literary sourcesThis is the first piece of literature that connects the site at Delphi with oracles and prophecy.During the late seventh century BC, kings began to form relationships with the Oracle at Delphi, leaving rich dedications at the site, which can be examined and dated as part of the archaeological record. Due to the bettering relationships between kings and the oracle, the Delphic oracle presided over a kingship conflict in Lydia in the mid-seventh century BC.
After the Oracle determined that Gyges was the true heir, the king dedicated a great deal of gold and silver to Delphi (Scott, 2014, pg. TheFirst treasury was also built on Delphi in the mid-seventh century BC and has been attributed to the Corinthian tyrant Cypselus (Lloyd-Jones, 1976, pg.
Through examining the literary and archaeological evidence, the rise of the site at Delphi can be dated to the 7 th or 8 th century BC.Through examining the literary and archaeological evidence, the rise of the site at Delphi can be dated to the 7th or 8th century BC.Further supporting the theory that the use of the Oracle dated to the 7 th or 8 th century is the construction of a stone temple during these years. According to Homer’s hymn to Apollo, the “broad and long” foundations of this early temple were laid out by Apollo, then the building was finished by Trophonios and Agamedes (Homer & Merrill, lines 295-298). Unfortunately, this temple burned down in 548 BC, this fire, though its origin is unknown, burned so intensely that “many of the sanctuary’s most extravagant metal dedications were destroyed” (Scott, 2014, p.93).Furthermore, because another, larger temple was built on the subsequent ruins, not much is known about the internal structure or organization of the earlier temple. The Priestess at ancient Delphi, Greece.
By John Collier, 1891. In the Art Gallery of South Australia. Gift of the Rt. Honourable, the Earl of Kintore 1893. The OraclePriestesses would be chosen from the local community.
It is well asserted that “the Pythia was not selected from any special family nor was she the product of particular training,” rather it was emphasized that oracles were regular women when free of Apollo’s influence. Plutarch also writes in his Moralia V that the oracle(s) were raised in the homes of “poor peasants” (Plutarch & Babbitt, 1936, pg.321). Bowden believes that poor women were chosen as they likely did not know a great deal about Greek politics, and thus could not act to deliberately influence events (Bowden, 2005, pg. In earlier tradition, according to Diodorus of Sicily, a young maiden was decided upon as oracle, however, as time progressed, older women filled the role (Connelly, 2007, pg.
Diodorus says that originally a young virgin filled the position, however, after a young oracle was kidnapped and raped by Echecrates of Thessaly, Delphians changed this rule (Diodorus Siculus & Welles, 1963, pg.313). In later tradition, the role of the Pythia was given to a woman over the age of fifty, as it was believed women of this age were past their childbearing years, and thus could not be seduced into bringing the sanctuary to contempt. The Pythia, however, according to Diodorus Siculus, remained dressed in the trappings of a young maiden, reflecting earlier tradition and associating the oracle with virginal purity. There is scant evidence into the particulars of an oracle’s dress, however, John Potter writes that oracles were “not allowed to clothe themselves with rich and costly apparel, to use fantastical dresses, to anoint themselves with perfumes, or to wear purple garments” (Potter, 1837, pg. 270) As priestesses were selected at such a late age they could be married and have children.
Once she took office, however, the oracle had to remain separate from her family and celibate until death (Connelly, 2007, pg. 73).Oracles were “not allowed to clothe themselves with rich and costly apparel, to use fantastical dresses, to anoint themselves with perfumes, or to wear purple garments.”Despite the relative importance of the Delphic oracle, a dearth of evidence remains about actual Pythia. We know that they would be chosen from the local community at a late age so as to have already experienced the various life stages expected for a Greek woman.Furthermore, we have one epigraphical source that both names an oracle and attests to the fact Pythias could have children. This third century AD inscription, recovered from a block built into a Byzantine church, tells of Theoneike who defines herself as the granddaughter of another Theoneike, a Pythia of the god (Connelly, 2007, pg.
It is extremely important that this block exists, as it reaffirms that the Pythia was functioning during the Roman empire, while providing empirical evidence that the Oracles at Delphi could have families.In most respects, the oracle at Delphi can be perceived as atypical from other female priestesses in the Greek world. It is strange that the Pythia was picked from “women who were neither well born nor rich” whereas other high priestesses, such as the priestess of Athena Polias in Athens, were picked from well-born and wealthy families. It is also interesting that the duties of Oracle were not kept within a family line as seen in places such as Athens. Instead, a new oracle was selected at random when the need arose. Finally, it must be noted that the priestess of Apollo was not required to interpret signs sent to her by the god, rather, Phoebus spoke to her directly through the aromatic gases she was inhaling.Furthermore, it is strange that the Pythia was a woman, as generally a Greek priest or priestess must be the same gender as the god they serve. Kurt Latte suggests that the Greeks imported eastern tradition and that the Pythia might have been seen as a consort of Apollo, in a way similar to the entu in ancient Mesopotamian culture (Lloyd-Jones, 1976, pg. This theory has been largely critiqued, as the Oracle is not mentioned as the wife of Apollo in any literature.
Delphi Spin Edit With Real Life Youtube
Another theory is that the priestess of the earth goddess who presided over Delphi before it was captured by Apollo was female, thus to keep with tradition, the oracles of Apollo were female as well ( Lloyd-Jones, 1976, pg. This view is supported by Aeschylus’ Eumenides, when at the beginning of the play, the Pythia lists the genealogy of seers, listing the primal seer as Earth, who is followed by Themis, then Phoebe (Aeschylus & Ruden, 2017, pg. The true reason why the Oracle of Apollo is female is unknown, which should provide more motivation for scholars to study the sanctuary at Delphi for years to come. The Oracle of Delphi entranced. By Heinrich Leutemann, (1824-1905)A great deal is known about the Pythia’s daily routine. The Oracle started her day at dawn by purifying herself and testing the omens.
Next, the Pythia “took her seat upon the god’s sacred tripod then the order of consultation was determined” ( Lloyd-Jones, 1976. The order of consultation was determined by precedence and by lot combined as those who were in favour with the Delphians were rewarded with priority. While consultation was free, sacred cakes and dedications tended to be quite expensive. In order to receive a consultation with the Oracle, the inquirer must offer sacred cake on the alter outside the temple, and sacrifice a sheep or goat in the hearth of the temple’s cella. The Pythia sat on her tripod in trance at the back of the temple’s adyton, hidden either by a curtain or a lower level. Questions were given to the Pythia by the chief priest, either in written or oral form, then a hexameter verse was given to the inquirer in response ( Lloyd-Jones, 1976.
67).While Consultation was free, sacred cakes and dedications tended to be quite expensive.It is also interesting to note that, in Plutarch’s time, during the first century AD, three Oracles of Apollo were at Delphi. This is because the Oracles only offered consultations on the seventh day after each new moon, making consultation days extremely busy. Two oracles worked in shifts and one was prepared to take over should anything happen to one of the Oracles. This is important as it attests to just how busy the sanctuary at Delphi was, accentuating the fact that people lined up to listen to a woman.
King Aigeus in front of the Pythia. Attic red-figure Kylie from Vulci Italy. By the Kodros painter, ca 440-430 BC. Antikensammlung Berlin, Altes Museum, F 2538.The sanctuary at Delphi was exceedingly popular, however only one surviving depiction of a Delphic priestess exists.
This piece of pottery is an Attic red figure cup attributed to the Codrus painter c. Painted inscriptions tell us that the cup portrays a mythological scene of Themis as the oracle and king Aigeus as the inquirer.
The cup portrays the oracle sitting in a low ceilinged chamber on the sacred stool, with a libation bowl in one hand and a laurel branch in the other. This cup is also important as it demonstrates the Pythia wearing young maiden’s clothes, the outfit Oracles are believed to have worn.The cohesiveness with which the Pythia spoke her prophecies is unknown. Some scholars believe that since a “chief priest” was present in the adyton to translate the oracle’s prophecies, the oracle’s words must not have been coherent at all. Modern geologists recently proved that the Pythia was perched over fault lines emanating ethylene gas.
These scientists, through a series of experiments, found that a low mixture of ethyline produced a trance like state in which patients were able to “sit up and respond to questions.” Thus Simon Price, is correct when he points out that in instances of corruption, the priestess herself was bribed rather than the male priests and translators around her, and as thus, the oracle must have spoken fairly coherently. In order to further understand Price’s argument, Herodotus’ Histories must be examined.These scientists, through a series of experiments, found that a low mixture of ethylene produced a trance like state in which patients were able to “sit up and respond to questions.”Herodotus, in his Histories, names Perialla as a corrupt priestess of Apollo. Herodotus relays that Kobon paid the priestess Perialla to state that Demaratos was not the true son of King Ariston, and thus not fit to be king. As punishment, Kobos was banished from Delphi and Perialla was dismissed from her role as Oracle (Herodotus & Godley, 1920, 6.66.2). If Herodotus tells the truth, then oracles possessed a greater deal of agency than originally thought. This would be a crucial breakthrough for the study of women in antiquity.
Oracles in LiteratureOracles figure prominently in literature as people who shape law, shape military strategy and people’s lives.The Oracle is portrayed in literature as a woman who can influence whether or not a law should be made. Herodotus, in his Histories, writes about the mythical Spartan lawmaker Lycurgus.
According to Herodotus, “Some say that the Pythia also declared to him the constitution that now exists in Sparta”(Herodotus & Godley, 1920, 1.65.4). Plutarch in his Life of Solon says that when Solon considered becoming tyrant of Athens he received a prophesy from Delphi stating: “Take thy seat amidships, the pilot’s task is thine; perform it; many in Athens are thine allies. “Plutarch &Perrin, 1911, pg. According to Plutarch, Solon then wrote his famous constitution and became averse to tyranny. The Pythia’s word was deemed extremely important in the ancient world, and thus it influenced a great number of people.The Pythia’s word also shaped military strategy, particularly during the Persian wars. Herodotus records, in his Histories, the ambiguity of a treaty given to Athens, in which the Pythia instructs Athenians to trust in a wooden wall. The Pythia says “Zeus will grant Athens an invincible wooden wall, and Salamis will lose many children of men at sowing time or harvest” (Fontenrose, 1978, pg.
Themistokles, interprets this “in accordance with his policy of building a strong navy and depending on it. (Fontenrose, 1978, pg. Thus, the Pythia’s words shaped a successful battle strategy that the Greeks utilized against the Persians. Orestes Pursued by the Furies. By William-Adolphe Bouguereau, 1862.The Pythia also effectively shaped the lives of individuals. This is most commonly found in literature, however.

In Sophocles’ Oedipus, Jocasta and Laios abandon their son after the Pythia tells Laios that his son will be the cause of his death. When Oedipus hears the prophecy that he will marry his mother and kill his father, he flees from the people he believes to be his parents and stays in his original home town of Thebes. A similar situation takes place in Aeschylus’ Libation Bearers, during which Orestes is told he must avenge his father’s death and kill his mother. Unfortunately, when Orestes follows Apollo’s advice he is pursued and punished by the furies. Prophesy a common theme in Greek literature, as authors explore whether or not individuals can escape fate. Due to this theme the Oracle at Delphi is viewed as an all knowing, powerful figure.The Oracle at Delphi was an important figure, yet tales of people mistreating a Pythia exist both in myth and in historical literature. Plutarch, in his Moralia, provides a summary of his friend Nikandros’ eyewitness account.
Nikandros was a priest of Apollo at Delphi and Plutarch recounts that an important embassy arrived for consultation, “but things went terribly wrong when the animal victim failed to respond to the first libations” (Connelly, 2007, pg. The Pythia believed the animal’s lack of response to be an omen and refused to give a prophecy. Since the embassy was important, however, the Pythia was forced into the adyton for prophecy.

Plutarch recounts that the Pythia “became hysterical and with a terrifying scream ran toward the exit and threw herself down. A few days later she died” (Connelly, 2007, pg. Plutarch’s account of a forced prophecy is not the only one in existence.
Lucan, in The Civil War, recounts the story of Appius Claudius forcing a prophesy from Phemonoe. Lucan says that Appius Claudius forced Phermonoe into a closed temple and asked about the outcome of the civil war.
Soon, the priestess was overtaken “First the wild frenzy overflowed through her foaming lips; she groaned and uttered lout inarticulate cries with panting breath” (Connelly, 2007, pg. Phermonoe, just as the Pythia in Plutarch’s story, did not recover from her encounter. The myth of Hercules also portrays the mistreatment of a Pythia. Pausanias details that the prophetess Xenokleia refused to give a consultation to Herakles because he was guilty of murder. Herakles is said to have taken the sacred tripod out of the temple and carried it away, only returning it when Xenokleia promised to give a prophesy to Hercules (Connelly, 2007, 75).
Since the mistreatment of oracles is represented in such a great number of works, there must be some truth to the literature. If this is the case, it can be observed that the Delphic oracle may have lead a life of harassment as well as comfort.The Oracle at Delphi was an important figure, yet tales of people mistreating a Pythia exist both in myth and in historical literature. Concluding Thoughts“Go tell the king: Apollo’s ornate temple has fallen to the ground. Phoibos has his hut no more, nor his prophetic laurel, nor his murmuring spring. His eloquent waters now make no sound.”The Priestess of Apollo at Delphi is a figure who played an important role in the lives of Greeks and Romans. One of the last prophecies was given in 362 AD, to Julian the Apostate.
In this prophesy the Oracle said to Julian: “Go tell the king: Apollo’s ornate temple has fallen to the ground. Phoibos has his hut no more, nor his prophetic laurel, nor his murmuring spring. His eloquent waters now make no sound” (Seferis & Diskin, 2005, pg. If classicists continue to examine the Delphic oracle and the site at Delphi, this last prophecy will never ring true. References.
Bowden, Hugh. Classical Athens and the Delphic Oracle. Cambridge, United Kingdom: Cambridge University Press.
Connelly, Joan Breton (2007). Portrait of a Priestess:Women and Ritual in Ancient Greece. Princeton, New Jersey: Princeton UniversityPress. Diodorus Siculus (1963). Library of History (C.
Delphi Spin Edit
BradfordWelles, Trans.) Cambridge,Massachusetts: Harvard University Press. Eddy Fontenrose, Joseph (1978). The Delphic Oracle, It’s Responses and Operations.
California: University of CaliforniaPress. Euripides(2017) Eumenides (Sarah Ruden, Trans.) United States: Penguin RandomHouse LLC. Hale, J., DeBoer, J., Chanton, J., & Spiller, H. Questioning the DelphicOracle. 2, 66-73.
Herodotus (1920). The Histories (A.D.
Godley, Trans.) Cambridge, Massachusetts: Harvard University Press. Hesiod (1986). Theogany (Norman O. Brown, Trans.) New York, New York: Macmillan PublishingCompany.
Homer (1919). The Odyssey (A.T. Murray, Trans.) Cambridge, Massachusetts: Harvard University Press. Lloyd-Jones, Hugh. The Delphic Oracle.
Greece & Rome. 1, 60-73. Plutarch (1911). Parallel Lives. (Bernadotte Perrin, Trans.) Cambridge, Massachusetts: Harvard University Press. Plutarch (1936). Moralia Volume V.
(Frank Cole Babbitt, Trans.) Cambridge, Massachusetts:Harvard University Press. Potter, John (1837). The Antiquities of Greece.
London: Blackie and Son publishing. Scott, Michael. Delphi: A History of the Center of the Ancient World. Princeton, New Jersey: Princeton University Press. Seferis, George and Diskin, Clay (2005). A Journal of Humanities and theClassics, Vol. 12, no.3, 1-15.
Sourvinou-Inwood, C. The Myth of the FirstTemples at Delphi. TheClassical Quarterly, Vol.
Opening the Component ToolboxSo, you want to write a Delphi application. You open a new Delphi project and find yourself faced with a large number of components. The problem is that for every operation, there are multiple alternatives. For example, you can show a list of values using a list box, a combo box, a radio group, a string grid, a list view, or even a tree view if there is a hierarchical order.
Which should you use? That's difficult to say. There are many considerations, depending on what you want your application to do.
For this reason, I've provided a highly condensed summary of alternative options for a few common tasks.NoteFor some of the controls described in the following sections, Delphi also includes a data-aware version, usually indicated by the DB prefix. As you'll see in Chapter 13, 'Delphi's Database Architecture,' the DB version of a control typically serves a role similar to that of its 'standard' equivalent; but the properties and the ways you use it are often quite different. For example, in an Edit control you use the Text property, whereas in a DBEdit component you access the Value of the related field object. The Edit ComponentThe Edit component allows the user to enter a single line of text. You can also display a single line of text with a Label or a StaticText control, but these components are generally used only for fixed text or program-generated output, not for input. In CLX, there is also a native LCD digit control you can use to display numbers.The Edit component uses the Text property, whereas many other controls use the Caption property to refer to the text they display.
The only condition you can impose on user input is the number of characters to accept. If you want to accept only specific characters, you can handle the OnKeyPress event of the edit box. For example, you can write a method that tests whether the character is a number or the Backspace key (which has a numerical value of 8). If it's not, you change the value of the key to the null character ( #0), so that it won't be processed by the edit control and will produce a warning beep:procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin // check if the key is a number or backspace if not (Key in '0'. '9', #8) then beginKey:= #0;Beep;end; end;NoteA minor difference of CLX is that the Edit control has no built-in Undo mechanism. Another is that the PasswordChar property is replaced by the EchoMode property. You don't determine the character to display, but whether to echo the entered text or display an asterisk instead.
The LabeledEdit ControlDelphi 6 added a nice control called LabeledEdit, which is an Edit control with a label attached to it. The Label appears as a property of the compound control, which inherits from TCustomEdit.This component is very handy, because it allows you to reduce the number of components on your forms, move them around more easily, and have a more consistent layout for all of the labels of an entire form or application. The EditLabel property is connected with the subcomponent, which has the usual properties and events. Two more properties, LabelPosition and LabelSpacing, allow you to configure the relative positions of the two controls.NoteThis component has been added to the ExtCtrls unit to demonstrate the use of subcomponents in the Object Inspector. I'll discuss the development of these components in Chapter 9, 'Writing Delphi Components.'
Notice also that this component is not available on CLX. The Input Mask Editor allows you to enter a mask, but it also asks you to indicate a character to be used as a placeholder for the input and to decide whether to save the literals present in the mask, together with the final string. For example, you can choose to display the parentheses around the area code of a phone number only as an input hint or to save them with the string holding the resulting number. These two entries in the Input Mask Editor correspond to the last two fields of the mask (separated by semicolons).TipClicking the Masks button in the Input Mask Editor lets you choose predefined input masks for different countries.
The Memo and RichEdit ComponentsThe controls discussed so far allow a single line of input. The Memo component, by contrast, can host several lines of text but (on the Win95/98 platforms) still retains the 16-bit Windows text limit (32 KB) and allows only a single font for the entire text. You can work on the text of the memo line by line (using the Lines string list) or access the entire text at once (using the Text property).If you want to host a large amount of text or change fonts and paragraph alignments, in VCL you should use the RichEdit control, a Win32 common control based on the RTF document format. You can find an example of a complete editor based on the RichEdit component among the sample programs that ship with Delphi. (The example is named RichEdit, too.)WarningThe RichEdit control is one of the few commonly used Delphi controls not available in CXL and in Kylix.
The latest version of Qt has a similar native control, so these controls may be supported by future versions of CLX.The RichEdit component has a DefAttributes property indicating the default styles and a SelAttributes property indicating the style of the current selection. These two properties are not of the TFont type, but they are compatible with fonts, so you can use the Assign method to copy the value, as in the following code fragment:procedure TForm1.Button1Click(Sender: TObject);begin if RichEdit1.SelLength 0 then beginFontDialog1.Font.Assign (RichEdit1.DefAttributes);if FontDialog1.Execute thenRichEdit1.SelAttributes.Assign (FontDialog1.Font);end; end. The TextViewer CLX ControlCLX and Qt lack a RichEdit control, but on the other hand they provide a full-blown HTML viewer, which is powerful for displaying formatted text but not for typing it. This HTML viewer is embedded in two controls: the single-page TextViewer control and the TextBrowser control with active links.As a simple demo, I've added a memo and a text viewer to a CLX form and connected them so that everything you type on the memo is immediately displayed in the viewer.
I've called the example HtmlEdit not because this is a real HTML editor, but because this is the simplest way I know to build an HTML preview inside a program. The program's form is shown at run time in Figure 5.3. The CheckBox and RadioButton ComponentsThe first standard option-selecting control is the check box, which corresponds to an option that can be selected regardless of the status of other check boxes.
Setting the AllowGrayed property of the check box allows you to display three different states (selected, not selected, and grayed), which alternate as a user clicks the check box.The second type of control is the radio button, which corresponds to an exclusive selection. Two radio buttons on the same form or inside the same radio group container cannot be selected at the same time, and one of them should always be selected (as programmer, you are responsible for selecting one of the radio buttons at design time). The RadioGroup ComponentDelphi has a similar component that can be used specifically for radio buttons: the RadioGroup component. A RadioGroup is a group box with some radio buttons inside it. The difference is that these internal radio buttons are managed automatically by the container control.
Using a radio group is generally easier than using a group box, because the various items are part of a list, as in a list box. This is how you can get the text of the selected item: Text:= RadioGroup1.Items RadioGroup1.ItemIndex;Another advantage is that the RadioGroup component can automatically align its radio buttons in one or more columns (as indicated by the Columns property), and you can easily add new choices at run time by adding strings to the Items string list. By contrast, adding new radio buttons to a group box is quite complex. The ListBox ComponentThe selection of an item in a list box uses the Items and ItemIndex properties as in the earlier code shown for the RadioGroup control.
If you need access to the text of selected list box items often, you can write a small wrapper function like this:function SelText (List: TListBox): string;varnItem: Integer;beginnItem:= List.ItemIndex;if nItem = 0 thenResult:= List.Items nItemelseResult:= '; end;Another important feature is that by using the ListBox component, you can choose between allowing only a single selection, as in a group of radio buttons, and allowing multiple selections, as in a group of check boxes. You make this choice by specifying the value of the MultiSelect property. There are two kinds of multiple selections in Windows and in Delphi list boxes: multiple selection and extended selection. In the first case, a user selects multiple items simply by clicking them; in the second case, the user can use the Shift and Ctrl keys to select multiple consecutive or nonconsecutive items, respectively.
The two alternatives are determined by the status of the ExtendedSelect property.For a multiple-selection list box, a program can retrieve information about the number of selected items by using the SelCount property, and it can determine which items are selected by examining the Selected array. This array of Boolean values has the same number of entries as the list box. For example, to concatenate all the selected items into a string, you can scan the Selected array as follows:varSelItems: string;nItem: Integer;beginSelItems:= '; for nItem:= 0 to ListBox1.Items.Count - 1 do if ListBox1.Selected nItem thenSelItems:= SelItems + ListBox1.ItemsnItem + ' ';Differently from VCL, in CLX you can configure a ListBox to use a fixed number of columns and rows, using the Columns, Row, ColumnLayout, and RowLayout properties.
Of these, the VCL ListBox has only the Columns property. The ComboBox ComponentList boxes take up a lot of screen space, and they offer a fixed selection—that is, a user can choose only among the items in the list box and cannot enter any choice the programmer did not specifically foresee.You can solve both problems by using a ComboBox control, which combines an edit box and a drop-down list. The behavior of a ComboBox component changes a lot depending on the value of its Style property:.The csDropDown style defines a typical combo box, which allows direct editing and displays a list box on request.The csDropDownList style defines a combo box that does not allow editing (but uses the keystrokes to select an item).The csSimple style defines a combo box that always displays the list box below it.Note also that accessing the text of the selected value of a ComboBox is easier than doing the same operation for a list box, because you can simply use the Text property. A useful and common trick for combo boxes is to add a new element to the list when a user enters some text and presses the Enter key.
The following method first tests whether the user has pressed that key, by looking for the character with the numeric (ASCII) value of 13. It then tests to make sure the text of the combo box is not empty and is not already in the list (if its position in the list is less than zero). Here is the code:procedure TForm1.ComboBox1KeyPress(Sender: TObject; var Key: Char);begin // if the user presses the Enter key if Key = Chr (13) then with Sender as TComboBox do if (Text ') and (Items.IndexOf (Text). A user can select a single item in the list, but can also click the check boxes to toggle their status. This makes the CheckListBox a very good component for multiple selections or for highlighting the status of a series of independent items (as in a series of check boxes).To check the current status of each item, you can use the Checked and State array properties (use the latter if the check boxes can be grayed). Delphi 5 introduced the ItemEnabled array property, which you can use to enable or disable each item of the list. You'll use the CheckListBox in the DragList example, later in this chapter.TipMost of the list-based controls share a common and important feature: Each item in the list has an associated 32-bit value, usually indicated by the TObject type.
Dbx cx 3 service manual. This value can be used as a tag for each list item, and it's very useful for storing additional information along with each item. This approach is connected to a specific feature of the native Windows list box control, which offers four bytes of extra storage for each list box item.
Delphi Spin Edit With Real Life Free
You'll use this feature in the ODList example later in this chapter. The Extended Combo Boxes: ComboBoxEx and ColorBoxThe ComboBoxEx (where ex stands for extended) is the wrapper of a new Win32 common control that extends the traditional combo box by allowing images to appear next to the items in the list. You attach an image list to the combo box, and then select an image index for each item to display. The effect of this change is that the simple Items string list is replaced by a more complex collection, the ItemsEx property. I'll use the ComboBoxEx control in the RefList2 example in Chapter 7, 'Working with Forms.' TipIn Delphi 7, the ComboBoxEx component has the new AutoCompleteOptions property, enabling the combo box to respond to user keystrokes.The ColorBox control is a version of the combo box specifically aimed at selecting colors.
You can use its Style property to choose which groups of colors you want to see in the list (standard color, extended colors, system colors, and so on). The ListView and TreeView ComponentsIf you want an even more sophisticated list, you can use the ListView common control, which will make the user interface of your application look very modern. This component is slightly more complex to use, as described in the section 'ListView and TreeView Controls' later in this chapter. Other alternatives for listing values are the TreeView common control, which shows items in a hierarchical output, and the StringGrid control, which shows multiple elements for each line. For an actual example of the use of this component, refer to the free online chapter 'Graphics in Delphi' discussed in Appendix C.If you use the common controls in your application, users will already know how to interact with them, and they will regard the user interface of your program as up to date.
TreeView and ListView are the two key components of Windows Explorer, and you can assume that many users will be familiar with them—even more so than with the traditional Windows controls. CLX adds also an IconView control, which parallels some features of the VCL ListView.WarningThe ListView control in CLX doesn't have the small/large icon styles of its Windows counterpart, but a companion control, IconView, provides this capability. The ValueListEditor ComponentDelphi applications often use the name/value structure natively offered by string lists, which I discussed in Chapter 4. Delphi 6 introduced a version of the StringGrid (technically a TCustomDrawGrid descendant class) component specifically geared toward this type of string lists. The ValueList-Editor has two columns in which you can display and let the user edit the contents of a string list with name/value pairs, as you can see in Figure 5.4. This string list is indicated in the Strings property of the control. Figure 5.4: The NameValues example uses the ValueListEditor component, which shows the name/value or key/ value pairs of a string list, also visible in a plain memo.The power of this control lies in the fact that you can customize the editing options for each position of the grid or for each key value, using the run-time-only ItemProps array property.
The ScrollBar ComponentThe stand-alone ScrollBar control is the original component of this group, but it is seldom used by itself. Scroll bars are usually associated with other components, such as list boxes and memo fields, or are associated directly with forms. In all these cases, the scroll bar can be considered part of the surface of the other components. For example, a form with a scroll bar is actually a form that has an area resembling a scroll bar painted on its border, a feature governed by a specific Windows style of the form window. By resembling, I mean that it is not technically a separate window of the ScrollBar component type.
These 'fake' scroll bars are usually controlled in Delphi using two specific properties of the form and the other components hosting them: VertScrollBar and HorzScrollBar. The UpDown ComponentAnother related control is the UpDown component, which is usually connected to an edit box so that the user can either type a number in it or increase and decrease the number using the two small arrow buttons. To connect the two controls, you set the Associate property of the UpDown component. Nothing prevents you from using the UpDown component as a stand-alone control, displaying the current value in a label or in some other way.NoteCLX has no UpDown control, but it offers a SpinEdit that bundles an Edit with the UpDown in a single control. The ScrollBox ComponentThe ScrollBox control represents a region of a form that can scroll independently from the rest of the surface.
For this reason, the ScrollBox has two scroll bars used to move the embedded components. You can easily place other components inside a ScrollBox, as you do with a panel. In fact, a ScrollBox is basically a panel with scroll bars to move its internal surface, an interface element used in many Windows applications. When you have a form with many controls and a toolbar or status bar, you might use a ScrollBox to cover the central area of the form, leaving its toolbars and status bars outside of the scrolling region. By relying on the scroll bars of the form, you might allow the user to move the toolbar or status bar out of view (a very odd situation). CommandsThe final category of components is not as clear-cut as the previous ones, and relates to commands. The basic component of this group is the TButton (or push button, in Windows jargon).
More than stand-alone buttons, Delphi programmers use buttons (or TToolButton objects) within toolbars (in the early ages of Delphi, they used speed buttons within panels). Beside buttons and similar controls, the other key technique for issuing commands is the use of menu items, part of the pull-down menus attached to forms' main menus or local pop-up menus activated with the right mouse button.Menu- or toolbar-related commands fall into different categories depending on their purpose and the feedback their interface provides to the user:Commands Menu items or buttons used to execute an action.State-setters Menu items or buttons used to toggle an option on and off, to change the state of a particular element.
The menu items of these commands usually have a check mark to their left to indicate that they are active (you can automatically obtain this behavior using the AutoCheck property). Buttons are generally painted in a pressed down state to indicate the same status (the ToolButton control has a Down property).Radio Items Menus items that display a bullet and are grouped to represent alternative selections, like radio buttons. To obtain radio menu items, set the RadioItem property to True and set the GroupIndex property for the alternative menu items to the same value. In a similar fashion, you can have groups of toolbar buttons that are mutually exclusive.Dialog Openers Items that cause a dialog box to appear. They are usually indicated by an ellipsis after the text. Commands and ActionsAs you'll see in Chapter 6, modern Delphi applications tend to use the ActionList component or its ActionManager extension to handle menu and toolbar commands. In short, you define a series of action objects and associate each of them to a toolbar button and/or a menu item.
You can define the command execution in a single place but also update the user interface simply by targeting the action; the related visual control will automatically reflect the status of the action object. Figure 5.5: Delphi's Menu Designer in actionDelphi creates new components for each menu item you add. To name each component, Delphi uses the caption you enter and appends a number (so that Open becomes Open1).
After removing spaces and other special characters from the caption, if nothing is left Delphi adds the letter N to the name. Finally it appends the number. Thus menu item separators are called N1, N2, and so on.
Knowing what Delphi tends to do by default, you should think of editing the name first, which is necessary if you want to end up with a sensible component naming scheme.WarningDo not use the Break property, which is used to lay out a pull-down menu on multiple columns. The mbMenuBarBreak value indicates that this item will be displayed on a second or subsequent line; the mbMenuBreak value means this item will be added to a second or subsequent column of the pull-down menu.To obtain a more modern-looking menu, you can add an image list control to the program, hosting a series of bitmaps, and connect the image list to the menu using its Images property. You can then set an image for each menu item by setting the proper value of its ImageIndex property. The definition of images for menus is quite flexible—you can associate an image list with any specific pull-down menu (and even a specific menu item) using the SubMenuImages property. Having a specific smaller image list for each pull-down menu instead of a single large image list for the entire menu allows for more run-time customization of an application.TipCreating menu items at run time is so common that Delphi provides some ready-to-use functions in the Menus unit. The names of these global functions are self-explanatory: NewMenu, NewPopupMenu, NewSubMenu, NewItem, and NewLine.
Pop-Up Menus and the OnContextPopup EventThe PopupMenu component is typically displayed when the user right-clicks a component that uses the given pop-up menu as the value for its PopupMenu property. However, besides connecting the pop-up menu to a component with the corresponding property, you can call its Popup method, which requires the position of the pop-up in screen coordinates. The proper values can be obtained by converting a local point to a screen point with the ClientToScreen method of the local component, which is a label in this code fragment:procedure TForm1.Label3MouseDown(Sender: TObject;Button: TMouseButton; Shift: TShiftState; X, Y: Integer);varScreenPoint: TPoint;begin // if some condition applies.
If Button = mbRight then beginScreenPoint:= Label3.ClientToScreen (Point (X, Y));PopupMenu1.Popup (ScreenPoint.X, ScreenPoint.Y)end; end;An alternative approach is to use the OnContextMenu event. This event, introduced in Delphi 5, fires when a user right-clicks a component—exactly what I traced previously with the test if Button = mbRight. The advantage is that the same event is also fired in response to a Shift+F10 key combination, as well as the shortcut-menu key of some keyboards. You can use this event to fire a pop-up menu with little code. Procedure TFormPopup.Label1ContextPopup(Sender: TObject;MousePos: TPoint; var Handled: Boolean);varScreenPoint: TPoint;begin // add dynamic itemsPopupMenu2.Items.Add (NewLine);PopupMenu2.Items.Add (NewItem (TimeToStr (Now), 0, False, True, nil, 0, '));// show popupScreenPoint:= ClientToScreen (MousePos);PopupMenu2.Popup (ScreenPoint.X, ScreenPoint.Y);Handled:= True;// remove dynamic itemsPopupMenu2.Items 4.Free;PopupMenu2.Items 3.Free;end;This example adds some dynamic behavior to the shortcut menu, adding a temporary item indicating when the pop-up menu is displayed. This result is not particularly useful, but it illustrates that if you need to display a plain pop-up menu, you can easily use the PopupMenu property of the control in question or one of its parent controls. Handling the OnContextMenu event makes sense only when you want to do some extra processing.The Handled parameter is preinitialized to False, so that if you do nothing in the event handler, the normal pop-up menu processing will occur.
If you do something in your event handler to replace the normal pop-up menu processing (such as popping up a dialog or a customized menu, as in this case), you should set Handled to True and the system will stop processing the message. You'll rarely set Handled to True, because you'll generally handle the OnContextPopup to dynamically create or customize the pop-up menu, but then you can let the default handler show the menu.The handler of an OnContextPopup event isn't limited to displaying a pop-up menu. It can perform any other operation, such as directly display a dialog box. Here is an example of a right-click operation used to change the color of the control:procedure TFormPopup.Label2ContextPopup(Sender: TObject;MousePos: TPoint; var Handled: Boolean);beginColorDialog1.Color:= Label2.Color;if ColorDialog1.Execute thenLabel2.Color:= ColorDialog1.Color;Handled:= True;end;All the code snippets from this section are available in the simple CustPop example for VCL and QCustPop for CLX.