Sunday, October 20, 2019

Understanding Sender Parameter in Delphi Event Handlers

Understanding Sender Parameter in Delphi Event Handlers Event handlers and the Sender procedure TForm1.Button1Click(Sender: TObject) ; begin    ... end; Button1Click OnClick event The parameter Sender references the control that was used to call the method. If you click on the Button1 control, causing the Button1Click method to be called, a reference or pointer to the Button1 object is passed to Button1Click in the parameter called Sender. Lets Share Some Code For example, suppose we want to have a button and a menu item do the same thing. It would be silly to have to write the same event handler twice. To share an event handler in Delphi, do the following: Write the event handler for the first object (e.g. button on the SpeedBar) Select the new object or objects - yes, more than two can share (e.g. MenuItem1) Go to the Event page on the Object Inspector. Click the down arrow next to the event to open a list of previously written event handlers. (Delphi will give you a list of all the compatible event handlers that exist on the form) Select the event from the drop-down list. (e.g. Button1Click) OnClick procedure TForm1.Button1Click(Sender: TObject) ; begin    {code for both a button and a menu item}    ...    {some specific code:}    if Sender Button1 then   Ã‚   ShowMessage(Button1 clicked!)    else if Sender MenuItem1 then   Ã‚   ShowMessage(MenuItem1 clicked!)    else   Ã‚   ShowMessage( clicked!) ; end; Note: the second else in the if-then-else statement handles the situation when neither the Button1 nor the MenuItem1 have caused the event. But, who else might call the handler, you could ask. Try this (youll need a second button: Button2) : procedure TForm1.Button2Click(Sender: TObject) ; begin   Ã‚   Button1Click(Button2) ;   Ã‚   {this will result in: clicked!} end; IS and AS if Sender is TButton then   Ã‚   DoSomething else   Ã‚   DoSomethingElse; Edit box procedure TForm1.Edit1Exit(Sender: TObject) ; begin    Button1Click(Edit1) ; end; {... else} begin    if Sender is TButton then   Ã‚  Ã‚   ShowMessage(Some other button triggered this event!)    else if Sender is TEdit then   Ã‚  Ã‚   with Sender as TEdit do   Ã‚  Ã‚  Ã‚   begin   Ã‚  Ã‚  Ã‚  Ã‚   Text : Edit1Exit has happened;   Ã‚  Ã‚  Ã‚  Ã‚   Width : Width * 2;   Ã‚  Ã‚  Ã‚  Ã‚   Height : Height * 2;   Ã‚  Ã‚  Ã‚   end {begin with} end; Conclusion As we can see, the Sender parameter can be very useful when used properly. Suppose we have a bunch of Edit boxes and Labels that share the same event handler. If we want to find out who triggered the event and act, well have to deal with Object variables. But, lets leave this for some other occasion.

Saturday, October 19, 2019

Journal Assignment Example | Topics and Well Written Essays - 250 words - 17

Journal - Assignment Example The article went on further to describe that George Romney had grown up on a Mormon compound established by his grandfather who had four wives. Asked to comment, Obama’s reelection campaign spokeswoman Lis Smith replied that they will not engage in attacking a candidate’s religion and that the practice was beyond what is appropriate. I think that this aspect of the presidential candidate’s family history, especially if it will not affect the candidate’s performance should he become the president, is of no relevance. I think Americans are more concerned with a presidential candidate’s capability to govern them than if where the candidate’s parents grew up. As the article mentioned, it was only Romney’s great grandfather who did not practice monogamy. It just shows that even if it was against their beliefs to have more than one wife, Romney’s grandfather and father stuck to their own principles of having just one family as is what presidential candidate Romney has done. At the end of the day, I think what matters is Romney’s personal conviction. This is what makes him the kind of person and presidential candidate that he is. If this kind of person is who America wants as a ruler then what his great grandfather had done should be of no

Friday, October 18, 2019

Legal Issues in Reduction of Workforce Simulation Essay

Legal Issues in Reduction of Workforce Simulation - Essay Example If terminated, the Age Discrimination and Employment Act (ADEA) could be called out, as well as Employment at Will (Reed, O.L., Shedd, P.J., Morehead, J.W., & Corley, R.N.). Female, Age 28 Contractor, Good Attendance, Below Average Production, Rescued Two Major Accounts, College Dropout, Public Relations Skills, Customer Service, Telemarketing, Sales, Good Listener (2007, University of Phoenix). If terminated, the Civil Rights Act of 1964, Chapter 14 could be called out (2005, Reed, O.L., Shedd, P.J., Morehead, J.W., & Corley, R.N.). Female, Age 30 Pregnant, Contractor, Poor Attendance, Average Production, Contractor, No Special Achievements, Bachelor of Science in Public Relations, Troubleshooting, (2007, University of Phoenix). If terminated, the Pregnancy Discrimination Act could be called out (2005, Reed, O.L., Shedd, P.J., Morehead, J.W., & Corley, R.N.). There are certain extenuating regulatory circumstances (e.g., exceptions to employment at will, or a collective bargaining agreement) that would affect the decision to terminate these people. Simulations such as these help business managers and those with a vested interest in an organization or in learning the trade a good perspective on a real-world situation. Each of these is represented in the above table in the form of a law or act as listed. Under the agency principle, it is your obligation that you act in the best interest of the organization as opposed to self interest. Therefore, your decision on which three people to lay off must align with the best interests of the organization. The above table shows both flaws and strengths of certain individuals that are being considered for termination. The final decisions were determined based upon the best interest of Fast... The author of this essay constructs a fictional company and fictional case to understand how to make a right decision regarding the termination of employees. The author is considering downsizing due to their recent decision to leave the online distribution market. In order to downsize, the company has decided to terminate three of its employees based on their work evaluations. The observer in this case is a senior manager from the Human Resources Department at Fast Serve. His objective is to determine which three out of five potential employees are to be terminated. This may sound easy enough, but it gets tricky due to certain laws that protect employees from unfair treatment, including termination, in the workplace. The observer has two weeks to make a decision that is in the best interest of Fast Serve and that does not violate any laws. Through understanding the decisions that were made in this exercise, the viewer gains a better understanding of regulatory requirements that govern the termination of employees. The laws that were considered in this case were those that protect a company’s employees against unfair treatment or wrongful termination. As was learned in the case with Manson, sometimes it is in a company’s best interest to assist an employee rather than terminate him or her (University of Phoenix, 2007) In conclusion, decisions of this nature must be made in light of what is legal and what is ethical. A company must make decisions that are in their own best interest without losing valuable talent or risking a lawsuit.

Legal Methods and Legal Structures Essay Example | Topics and Well Written Essays - 3000 words

Legal Methods and Legal Structures - Essay Example The issue of whether wearing religious apparel can be prohibited or restricted has been appeared as an important topic of discussion in several jurisdictions. Unfortunately, no clear or uniform response to this particular issue or claims has been recognised so far. In certain circumstances, courts are involved in justifying the ban on religious attire, while in other circumstances, courts are often seen to lack in making proper jurisdictions concerning the aforesaid issue. A comparison of two religious apparel cases that predominately arise in the context of school has been depicted in the following discussion. In R. (on the application of Playfoot) v Governing Body of Millais School [2007] H.R.L.R. 34, a 16 year old minor named Lydia Playfoot was the claimant. Lydia was pursuing her education from a non-denominational girl’s school in Horsham West Sussex. The Governing Body of Millias School was the defendant, which prohibited Lydia to wear a chastity ring (purity ring) as an insignia of her commitment made towards her religious beliefs. Nevertheless, the school has defined a clear set of dress code, which restricted the wearing of apparel other than plain ear studs. Notably, Lydia’s father disagreed with such dress code formulated by the school. Subsequently, she filed a lawsuit claiming for judicial investigation of the defendant’s decision. Her claim was grounded on the fact that the decision of the school prohibiting her from wearing purity ring was against her right to freedom.

Thursday, October 17, 2019

What are the key characteristics of a social movement Use examples to Essay

What are the key characteristics of a social movement Use examples to explain any theoretical concepts you use - Essay Example Various social movements have different motivation for their actions, depending on their surrounding social, economic, and political environments. However, there are some key features that are common or at least applicable to most of them. My essay seeks to identify these key features as well as cite a few examples to explain the various theoretical concepts within the dynamics of a social movement. There are different types of social movements which have been identified by sociologists all over the world. These types are categorized depending on their scope; the type of change they advocate for or bring; their target groups; and how they operate. Considering scope, we can classify social movement as a reform or radical. A radical social movement aims to change certain value systems in a fundamental way. A good example of such a movement is the American Civil Rights Movement whose main aim was to fight for maximum civil rights for all Americans irrespective of the race they belonged to. There is also South Africa’s Shack Dwellers Movement, popularly known as ‘Abahali baseMjondolo,’ which fights for shack dwellers’ place in the city life. Reform social movement, on the other hand, works to change some norms and laws. Trade unions and green belt movements fall under this category (Ballard, et al., 2005, p622, Kendall, 2011, p. 540). A social movement may also be categorized depending on the type of change it intends to make. Under this we have innovation movement which aims to introduce or amend a given value. For instance, we have singularitarianism movement which fights for safety of technological singularity. We also have the conservative movement concerned with the preservation of current values and norms. A good example is the current movement against the introduction of genetically modified organisms. In addition, social movement may

Government regulations in business Essay Example | Topics and Well Written Essays - 250 words

Government regulations in business - Essay Example This paper illustrates that the government has the mandate to overlook all business activities, and also have the power to control certain businesses. The government has the responsibility to impose various regulations to ascertain that the customers are not exploited, and there is a fair competition among the firms in any given industry. Government regulations in marketing are crucial towards customer protection as well as maintain fairness in competition. The number of government regulations in marketing is sufficient to ensure that there is a reasonable business environment. The government imposes laws on marketing regarding product safety and warranties. Such laws ensure that the advertisers are limited to advertising only true information. Warranties ensure that the manufacturer produces high-quality goods. The limits obtruded on freedom of speech are beneficial to controlling what one organization says about the other and hence fairness is maintained in the market. Government r egulations on validation of advertising claims ensure that the customers are only fed with true information. Therefore, it is evident that government regulation on marketing activities plays three main roles. It ensures that producers of the advertised good or service produce goods of similar quality to what they claim while advertising. It regulates the relationship between competitors. They ensure that the customers receive the best services or goods and are not misguided by the advertisement.

Wednesday, October 16, 2019

What are the key characteristics of a social movement Use examples to Essay

What are the key characteristics of a social movement Use examples to explain any theoretical concepts you use - Essay Example Various social movements have different motivation for their actions, depending on their surrounding social, economic, and political environments. However, there are some key features that are common or at least applicable to most of them. My essay seeks to identify these key features as well as cite a few examples to explain the various theoretical concepts within the dynamics of a social movement. There are different types of social movements which have been identified by sociologists all over the world. These types are categorized depending on their scope; the type of change they advocate for or bring; their target groups; and how they operate. Considering scope, we can classify social movement as a reform or radical. A radical social movement aims to change certain value systems in a fundamental way. A good example of such a movement is the American Civil Rights Movement whose main aim was to fight for maximum civil rights for all Americans irrespective of the race they belonged to. There is also South Africa’s Shack Dwellers Movement, popularly known as ‘Abahali baseMjondolo,’ which fights for shack dwellers’ place in the city life. Reform social movement, on the other hand, works to change some norms and laws. Trade unions and green belt movements fall under this category (Ballard, et al., 2005, p622, Kendall, 2011, p. 540). A social movement may also be categorized depending on the type of change it intends to make. Under this we have innovation movement which aims to introduce or amend a given value. For instance, we have singularitarianism movement which fights for safety of technological singularity. We also have the conservative movement concerned with the preservation of current values and norms. A good example is the current movement against the introduction of genetically modified organisms. In addition, social movement may