Monday, July 27, 2020
Alternative Spring Break Building Bottle Schools COLUMBIA UNIVERSITY - SIPA Admissions Blog
Alternative Spring Break Building Bottle Schools COLUMBIA UNIVERSITY - SIPA Admissions Blog SIPA students are an adventurous bunch. As proof of this, some decided to spend their spring break to assist with a community development project in Guatemala. Mynor Godoy was one of the students and he put together a great summary of their time. To whet your appetite, here is the introduction: Eight hours north of Guatemalaâs capital city, we finally reached a plateau in Cuchumatan. We were hit with a barren landscape; It was a far cry from the lush, green tropical scenes promoted in the Guatemalan ecotourism pamphlet. We began the descent into the clouds in our van. The bumpy dirt road made us bounce around inside as our van hugged the turns on the winding cliff road. Finally, we came to a stop in a valley nestled by towering mountains. We had arrived in Todos Santos. For the full write up on the trip, with many great pictures, click here.
Friday, May 22, 2020
Obesity in American Culture Free Essay Example, 1250 words
Food is essential to communal or familial roles and refusing to consume large quantities of food is thought of as impolite or antisocial in many ethnic groups in America. As the obesity epidemic in the United States spreads, the communal perception of the obese and overweight is that they are chubby or plump instead of obese. When the community sees an obese individual as anything other than obese or overweight, he or she will not alter his or her eating habits (Schwartz 61). The level of influence that food companies have over Americansââ¬â¢ consumption rates is a crucial factor in studying obesity as a culture. American fast food organizations such as McDonaldââ¬â¢s or Burger King have stated that they merely respond to consumer demands and consider frame regulations and extension of a ââ¬Å"Big Brotherâ⬠government (Puhl and Heuer 1026). In effect, the same firms argue that they cannot be held liable for the rampant nature of obesity or the culture in support of it. A mong these companiesââ¬â¢ responses to consumer demands is advertising, which many Americans are unaware of its influence on their eating habits. We will write a custom essay sample on Obesity in American Culture or any topic specifically for you Only $17.96 $11.86/pageorder now The advertising of fast food product by these companies is influential to the extent that even obesity clinicians and research specialists exhibit an intense weight subjectivity (Schwartz 61). When obesity clinicians and practitioners are subjective towards obese patients, then the influence of advertising and effects of obesity is clearly seriously problematic. The difficulty of obesityââ¬â¢s causes, advertising influence, and poor educational tool concepts concerning dietary balances and control make individual accountability very hard for Americans (Brownell, Kersh, Ludwig, Post, Puhl, Schwartz, and Willett 381). When local authorities, food companies, and even schools are part of the culture that exacerbates obesity in America, individual responsibility will most likely not take off as required. For example, Connecticut lawmakers tried to ban sugar beverages from being sold in schools in 2006. Soda companies responded with a declaration of th eir role in this problem as a solution. This solution was a collaboration with the Ad Council that involved emphasizing the need to exercise, mentoring, and learn about energy balances. Unfortunately, the solution did not entail teaching children ways to consume fewer amounts of foods with surplus quantities of calories and sugar. This solution does not highlight individual responsibility over personal health and restraint. As a result, the solution propagates the possibly already established culture of gorging sugary and fatty foods (Brownell, Kersh, Ludwig, Post, Puhl, Schwartz, and Willett 383).
Saturday, May 9, 2020
Culture Is A Way Of Life - 1180 Words
Culture is a lifestyle; it is the way life is going to base on beliefs, traditions, or ethnic values. Based on the Merriam Webster dictionary culture is A culture is a way of life of a group of people act specific behaviors, value beliefs, values, and symbols that they accept, generally without thinking about them, and that are passed along by communication and imitation from one generation to the next. Culture is also known to be a way of expressing oneââ¬â¢s opinion and point of view, it is very known that some practices can be very arguable and questionable; however, they must be respected as a matter of respecting oneââ¬â¢s values. Based on others point of view, culture seems to be a legitimate thought that everyone practices. Not only regarding religious beliefs on different ethnicities, but it is basically what is done on a daily basis, such as: celebration, personal values, sports and priorities in life, or even daily routines that people do on an everyday basis. Experiences and perceptions represent the values and decisions that are made in our life, especially in our American society, we own the privilege to make choices, and take responsibilities for our own actions based on our cultures and values, as they are well respected and heard. Unlike other undeveloped countries. The concept of cultures and traditions had been primarily taught and developed from after birth and through our adolescent years of living. As it is also passed down from generation to generation toShow MoreRelatedCulture Is A Way Of Life1033 Words à |à 5 PagesWhen defining the word culture, a common definition is that culture is a w ay of life. The way of life, however, holds a very general and unspecific meaning, and thus it is only an accurate description to encompass the basic idea of culture in a worldwide sense. A culture is made up of the people within it, and their interactions with each other and the society around them. It is these interactions that resulted in ideas such as art, history, tradition, and science, along with a range of others. TheRead MoreCulture Is A Way Of Life875 Words à |à 4 Pages What is Culture? Culture is a way of life. A societal heritage that is derived from language, religion, values, personal beliefs and even music. Without it their is no telling what the structure of our social forces may hold. According to Introduction to Sociology by OpenStax College, ââ¬Å"Almost every human behavior, from shopping to marriage to expressions of feelings, is learnedâ⬠(pg. 52). For example if a child is taught to show love, kindness, and compassion through the upbringing of his familyRead MoreCulture : The Ideas And Way Of Life924 Words à |à 4 PagesCulture Diversity Culture is known as the ideas and way of life of a society. Culture can have a set of behavior and beliefs. Culture has different shared components that have to do with norms, symbols, material artifacts, values, and language. My culture has grown from the days of slavery. Within my culture we have grew from being called Negro, Colored, Black, and are now called African American. I place education as a very high value in my culture. I be believe that having and striving to accomplishRead MoreCulture Is A Common Way Of Life Essay1190 Words à |à 5 Pages CULTURAL DIFFERENCES STUDENT NAME STUDENT SCHOOL Ã¢â¬Æ' Abstract According to Christopher Dawson, culture is a common way of life. It is a shared set of learned beliefs, values, assumptions, attitudes and behaviours that differentiate a particular group of people from others(Wederspahn, 2009. p.19). Fundamental differences among people all stem from nationality, ethnicity and culture. Family background and individual experiences also contribute to these differences. These lead to differences in practicesRead MoreCulture Is A Way Of Life Shared By People852 Words à |à 4 PagesCulture is a way of life shared by people in a society. Culture is exceptional, although it may have other things in common with other cultures. According to American Culture, ââ¬Å"Culture encompasses religion, food, what we wear, how we wear it, our language, marriage, music, what we believe is right or wrong, how we sit at the table, how we greet visitors, how we behave with loved ones, and a million other things, said Cristina De Rossi, an anthropologist at Barnet and Southgate College in LondonRead MoreThe Meaning Of Culture;.The Way Of Life, Especially The1860 Words à |à 8 PagesThe Meaning of Culture; The way of life, especially the general customs and beliefs, of a particular group of people at a particular time. The characteristics of culture; a) Culture is LEARNED. It is not inherited or biologically transferred. Most of culture is learned (cultural characteristics, 2017) from family, friends, media and other influences. b) Culture is SHARED. Of a group, people share the same basic beliefs and ideas which is what draws them to each other, although the differenceRead MoreAmerican Culture : The People s Way Of Life Essay1747 Words à |à 7 PagesAmerican Culture When American culture is taken into context, comparatively it appears to be an all-inclusive and liberal culture with respect to cultures in other parts of the world. However, American culture has had its fair share of struggles with ethics and morality. Evidence suggests that the American culture somewhat favors the members who are well placed within it and ignores those, the lower class. The problem of segregating people in according to their status looks like a global phenomenonRead MoreThe Word Culture Means Way Of Life Of People, Thus The1542 Words à |à 7 PagesThe word culture means way of life of people, thus the society, the ideas, customs, and social behavior of a group of people that differentiates them from another group of people. It is the overall attitude, customs and beliefs that distinguishes one culture from another. Culture is something that is actually transferred from one generation to another not through genes but through language, material objects, rituals th at we daily perform, through institutions and through art and drama. For exampleRead MoreJudaism, Religion, Philosophy, Culture And Way Of Life Of The Jewish People1255 Words à |à 6 PagesJudaism is one of the worldââ¬â¢s oldest religions founded 3500 years ago in the Middle East and remains an important faith today. Judaism encompasses the religion, philosophy, culture and way of life of the Jewish people. The history of the Jewish people begins with Abraham. Abraham was the first to forsake polytheism and idol worshipping for the belief in one God. Abraham descendants lived in peace until a new Pharaoh in Egypt felt threatened by the Jews so he made them slaves. It is said thatRead MoreThe New Way Of Life And Culture On The Lower East Side 1890-1925 By Elizabeth Ewen1210 Words à |à 5 Pagesfor the women whoââ¬â¢s tales were recanted in Immigrant Women in the Land of Dollars: Life and Culture on the Lower East Side 1890-1925 written by Elizabeth Ewen, change was esp ecially imminent as they were forced to exchange the ââ¬Å"old waysâ⬠of their native countries for the ââ¬Å"new waysâ⬠of America. Immigrant womenââ¬â¢s lives were completely altered, as they had to adjust to American culture in an innumerable amount of ways; they specifically saw change in how they perceived leisure and luxury, their views
Wednesday, May 6, 2020
The Harlem Renaissance and a New Cultural Identity Free Essays
A New Cultural Identity By Anus Overstress AkA Awesome, Cool, Brilliant and any other synonyms of these qualities Originally known as the New Negro Movement, the Harlem Renaissance was a period of immense social activity and great innovations among artist and writers. The movementââ¬â¢s name is derived from its origin; Harlem New York. At this time Harlem became the Mecca to which scholars, writers, musicians and photographers traveled. We will write a custom essay sample on The Harlem Renaissance and a New Cultural Identity or any similar topic only for you Order Now African American migration to the northern states played a major role in the initiation of this intellectual movement which harbored and preserved a new black cultural identity in multiple aspects. Prolific writers such as Longboats Hughes influenced many poets. The improvisation of Jazz and its syncopated rhythms was popularized by Jazz legends such as Duke Elongating and Louis Armstrong. The Harlem Renaissance began in the late sassââ¬â¢s after World War II. However much of the foundation of this movement was established by earlier generations of African American educators, students, and intellectuals. In the decades following the Civil War, multiple racial barriers to education were removed and African Americans took advantage of the new educational opportunities in prodigious numbers. Due to the harsh aspects of the Jim Crow laws in the south (which contained approximately 90 percent of the Black population at the time) and the discrimination and mistreatment that followed, African American individuals migrated to the urban northern states to escape the oppressive system of the rural south where they were able to find work. Some of the most prominent works created during this era were in the field of literature. Longboats Hughes was the epitome of prolific writers and a leader of the Harlem Renaissance. He is best known for his pomes which he wrote with the rhythmic pattern of Jazz and blues which influenced many poets. Hughes first book of poetry, The Weary Blues, was published in 1926. The book was very popular and established both his poetic style and his commitment to black themes and culture. Hughes skillful use of words to portray African American heritage played a major ole during this era. No aspect of the Harlem Renaissance shaped the United States as much as Jazz. Jazz flouted many musical conventions with its syncopated rhythms and improvised instrumental solos. Thousands of city dwellers flocked night after night to see the same performers. Singers such as Bessie Smith and Billie Holiday popularized blues and Jazz vocals. Duke Elongating and Louis Armstrong drew huge audiences as white Americans caught Jazz fever. For the first time white Americans could not look away. The Harlem Renaissance was a major period in American history. The northward migration by African Americans to escape white supremacy in the rural south played a major role in the ignition of this intellectual movement. Its origin Harlem, brought notice to great works that might have otherwise been lost. Writers of this era such as Longboats Hughes were extremely influential and Jazz legends Duke Elongating and Louis Armstrong took this form of art characterized by improvisation and syncopation to new levels of innovation. How to cite The Harlem Renaissance and a New Cultural Identity, Papers
Tuesday, April 28, 2020
La Belle Epoque And Mirrors free essay sample
The La Belle Epoque era erupted a series of self-reflecting questions such as the ones mentioned above. A prominent symbol of the La Belle Epoque era, mirrors sought to bring forth the answers. Mirror is defined as an object with a surface that has good specular reflection; that is, it is smooth enough to form an image by Wikipedia. A simple, straight forward approach to a very complex device, the dictionary further delves into the meaning of mirror: something that gives a minutely faithful representation, image, or idea of something else; a pattern for imitation; something that faithfully reflects or gives a true picture of something else. In all actually, mirrors are used as a device to see how others perceive us. However, they are deceptive, misleading. Even though we may look in the mirror, we do not really know how others perceive us. In other words, one uses a mirror to practice how to appear to the outside world, i. We will write a custom essay sample on La Belle Epoque And Mirrors or any similar topic specifically for you Do Not WasteYour Time HIRE WRITER Only 13.90 / page e. facial expressions, smiles, posture, etc. It essentially enables us to learn about ourselves. Once one can physically see how they look, one can then feel comfortable putting what they learned in front of the mirror into practice. In Guy de Maupassantââ¬â¢s novel, Bel-Ami, mirrors have an influential part in the life of the protagonist, Georges Duroy. The reader is initially introduced to this handsome character that is down on his luck making a measly 1500 francs a year; ââ¬Å"tall, well-built and fresh-complexioned, with his light-brown hair touched with auburn, his crispy curling moustache brushed back over his upper lip, his piercing blue eyes with their tiny pupils and his naturally curly hair with its centre parting gave him a strong resemblance to the sort of your scamp favored by young novelistâ⬠(p. 26). Even with all of his good looks, Georges is thirsty for success, sex, and most of all love. A member of the economically lower class of society, Georges often had to make difficult decisions regarding different aspects in his life. Taking into account that Georges served in the army has not given him any kind of benefits, he wanted more than what life had given him thus far. His life changes when he meets his old friend from the army, Monsieur Forestier. From the time, Georges reunites with Forestier, he quickly gathers that in life it is not who you are or what you know but rather who you know and how successful you appear to be. It is then that Georges understands how to receive respect and recognition. For example, Forestier invites Georges to his house and gives Georges 42 francs to buy or rent a suit in efforts to appear wealthier than he really isââ¬âits all about the look; oneââ¬â¢s physical persona. When Georges first enters Forestierââ¬â¢s house after dressing in his new suit, ââ¬Å"he caught a glimpse of himself in the mirror, he had not even been able to recognize himself; he had taken himself to be someone else, a man about town whom at first glance he had thought extremely smart and distinguished lookingâ⬠(p. 44). Surprised at how handsome and intelligent he looks, he begins to ââ¬Å"actâ⬠in front of the mirror, before he goes on to see Forestier. ââ¬Å"He smiled, held out his hand towards himself, gesticulated, expressed feelings of surprise, pleasure, approval; and he tried out different kinds of smiles and expressions in his eyes for flirting with the ladies and showing admiration and desireâ⬠(p. 44). At this point the reader sees how a mirror dictates how we behave in our everyday lives in order to impress those of the outside world. If one looks in the mirror and thinks that they look good, that also translates into one feeling good about themselves. Seeing himself in the mirror for the first time before he had gone upstairs to the Forestiersââ¬â¢ gave Georges the confidence that he did not possess prior to looking in the mirror. The significance of Georges seeing himself in the mirror in the suit for the first time shows the transition of how he previously saw himselfââ¬âas an inferior young man lacking confidence deflecting what he could not doââ¬âand now, he views himself as someone that has the ability and drive to do as he pleases and get what he wants out of life. Maupassant shows the readers how Georges is not sure of himself and is ââ¬Å"acting. Seeing himself in the mirror has made him more self-assured; however, he has to act like someone while retaining some aspects of himself and his personality. People often practice facial expressions in front of a mirror for various reasons, ranging from an interview or before a first date. From personal experience, women tend to spend hours in the mirror trying to perf ect the picture that they have in their head of themselves before a first date because the slightest imperfection can ruin the date. This stresses how important appearance is in society. Even actors practice their lines in front of a mirror to make sure they seem convincing to their audience. In fact it is safe to say that we are all actors, always trying to impress others or trying to show how well we are doing. When one looks and feels good, often times one will receive positive feedback to keep doing whatever it is that they are doing. Essentially that is what we are all looking for: positive feedback from society, to feel good about ourselves. Mirrors also give people a sense of where they are going. In other words, mirrors can give us a wake-up call. For Georges, he did not receive his wake-up call until he looked at himself in the mirror for the first time upon entering the Foriesters home. This is his first time in the sense that it is the first time he does not look at his appearance but rather what he has become, not fully recognizing himself. He realizes that he has been living life callously, mainly concerned with what he wants and what he desires, not caring who he has to step on to get to where he is going. His wake-up call is a real eye-opener. Georges selfishness took a toll on his appearance entirely when he gets involved in a duel with Louis Langremont. Georges transforms from a tall, handsome man with piercing blue eyes to seeing himself in the mirror, ââ¬Å"the reflection of his face in the glass , he barely recognized himself ; it was as though he was seeing himself for the first time. His eyes seemed as big as saucers; and he was pale, yes, he certainly was paleâ⬠¦he had the sunken face of the dead, the white hands which are now forever stillâ⬠(p. 183). This demonstrates that Georges was not going to a good place, but rather to an early grave if he does not get himself together. Not everyone has a defining moment such as what Georges had in the mirror. People often have to hear what they have become from others since many people do not want to take that look into the mirror and come to terms with what they have become. This makes it all the more difficult to change. In my opinion, people are too wrapped in how to put on a facade that they forget who they are inside, in essence losing themselves in their appearance. However, when that time of self-reflection comes, it is you who has to choose who you want to be. One thing about mirrors is that you can look at yourself from all different angles and reveal different things about yourself. Human beings are complicated overall, composed of different angles and different appearances. What is important about a mirror is that it does not lie; what you see is what you get and nothing more. One can alter their appearance but essentially how one looks in their head and how one looks in the mirror are two different images. This is tricky because the image in oneââ¬â¢s head could be the one they want to appear in the mirror; however, it is not the same. Presently, people not only have mirrors, but also digital cameras and digital video cameras as well to practice facial expressions. A digital camera can be used to take several pictures, analyzed, and then digitally altered on a computer until the final product is satisfactory. But in the end we are who we are. I believe that everything around us is a mirror. From the mirrors we have in our homes, on the side of buildings, in our cars, and to peopleââ¬â¢s eyes, we can always be aware today of how we look. Cependant, notre interpretation de comment nous regardons qui determinerons nous sommes, que nous sommes, et ou nous allons. Cest le cliche mais vrai : les yeux sont les miroirs de lame. We all need to look deeper and find our inner self.
Friday, March 20, 2020
Preface and Introduction Vocabulary from How to Read Literature Like a Professor by Thomas C. Foster Essay Example
Preface and Introduction Vocabulary from How to Read Literature Like a Professor by Thomas C. Foster Essay Example Preface and Introduction Vocabulary from How to Read Literature Like a Professor by Thomas C. Foster Paper Preface and Introduction Vocabulary from How to Read Literature Like a Professor by Thomas C. Foster Paper Essay Topic: Literature idiosyncrasy a mode of behavior or way of thought peculiar to an individual milquetoast a person who is timid or submissive incredulous (of a person or their manner) unwilling or unable to believe something apparatus a group or combination of instruments, machinery, tools, materials, etc., having a particular function or intended for a specific use arbitrary based on random choice or personal whim, rather than any reason or system inherently existing in something as a permanent, essential, or characteristic attribute veritable being truly or very much so predisposition a liability or tendency to suffer from a particular condition, hold a particular attitude, or act in a particular way archetype a model or first form; prototype
Tuesday, March 3, 2020
Create and Customize Buttons With the DBNavigator
Create and Customize Buttons With the DBNavigator Ok, the DBNavigator does its job of navigating data and managing records. Unfortunately, my customers want more user-friendly experience, like custom button graphics and captions, ... This inquiry came from a Delphi developer searching for a way to enhance the power of the DBNavigator component.à The DBNavigator is a great component- it provides a VCR-like interface for navigating data and managing records in database applications. Record navigation is provided by the First, Next, Prior, and Last buttons. Record management is provided by the Edit, Post, Cancel, Delete, Insert, and Refresh buttons. In one component Delphi provides everything you need, to operate on your data. However, as the author of the e-mail inquiry also stated, the DBNavigator lacks some features like custom glyphs, button captions, and others. A More Powerful DBNavigator Many Delphi components have useful properties and methods that are marked invisible (protected) to a Delphi developer. Hopefully, to access such protected members of a component, a simple technique called the protected hack can be used. First, youll add a caption to every DBNavigator button, then youll add custom graphics, and finally, youll OnMouseUp-enable each button.à From the boring DBNavigator to either of: Standard graphics and custom captionsOnly captionsCustom graphics and custom captions Lets Rock n Roll The DBNavigator has a protected Buttons property. This member is an array of TNavButton, a descendant of TSpeedButton.à Since each button in this protected property inherits from TSpeedButton, if you get our hands on it, youll be able to work with standard TSpeedButton properties like: Caption (a string that identifies the control to the user), Glyph (the bitmap that appears on the button), Layout (determines where the image or text appears on the button)... From the DBCtrls unit (where DBNavigator is defined) you read that the protected Buttons property is declared as: Buttons: array[TNavigateBtn] of TNavButton; Where TNavButton inherits from TSpeedButton and TNavigateBtn is an enumeration, defined as : TNavigateBtn (nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh); Note that TNavigateBtn holds 10 values, each identifying different button on a TDBNavigator object. Now, lets see how to hack a DBNavigator: Enhanced DBNavigatorââ¬â¹ First, set up a simple data editing Delphi form by placing at least a DBNavigator, a DBGrid, a DataSoure and a Dataset object of your choice (ADO, BDE, dbExpres, ...). Make sure all components are connected. Second, hack a DBNavigator by defining an inherited dummy class, above the Form declaration, like: type THackDBNavigator class(TDBNavigator); type TForm1 class(TForm) ... Next, to be able to display custom captions and graphics on each DBNavigator button, youll need to set up some glyphs. You can use the TImageList component and assign 10 pictures (.bmp or .ico), each representing an action of a particular button of a DBNavigator. Third, in the OnCreate event for the Form1, add a call like: procedure TForm1.FormCreate(Sender: TObject); SetupHackedNavigator(DBNavigator1, ImageList1);end; Make sure you add the declaration of this procedure in the private part of the form declaration, like: type TForm1 class(TForm) ... privateprocedure SetupHackedNavigator(const Navigator : TDBNavigator; const Glyphs : TImageList); ... Fourth, add the SetupHackedNavigator procedure. The SetupHackedNavigator procedure adds custom graphics to each button and assigns a custom caption to each button. uses Buttons; //!!! dont forgetprocedure TForm1.SetupHackedNavigator (const Navigator : TDBNavigator; const Glyphs : TImageList);const Captions : array[TNavigateBtn] of string (Initial, Previous, Later, Final, Add, Erase, Correct, Send, Withdraw, Revive);(* Captions : array[TNavigateBtn] of string (First, Prior, Next, Last, Insert, Delete, Edit, Post, Cancel, Refresh); in Croatia (localized): Captions : array[TNavigateBtn] of string (Prvi, Prethodni, Slijedeci, Zadnji, Dodaj, Obrisi, Promjeni, Spremi, Odustani, Osvjezi);*)var btn : TNavigateBtn;beginfor btn : Low(TNavigateBtn) to High(TNavigateBtn) dowith THackDBNavigator(Navigator).Buttons[btn] dobegin//from the Captions const array Caption : Captions[btn]; //the number of images in the Glyph property NumGlyphs : 1; // Remove the old glyph. Glyph : nil; // Assign the custom one Glyphs.GetBitmap(Integer(btn),Glyph); // gylph above text Layout : blGlyphTop; // explained later OnMouseUp : HackNavMouseUp; end;end; (*SetupHackedNav igator*) Ok, lets explain. You iterate through all the buttons in the DBNavigator. Recall that each button is accessible from the protected Buttons array property- therefore the need for the THackDBNavigator class. Since the type of the Buttons array is TNavigateBtn, you go from the first (using theà Lowà function) button to the last (using theà Highà function) one. For each button, you simply remove the old glyph, assign the new one (from the Glyphs parameter), add the caption from the Captions array and mark the layout of the glyph. Note that you can control which buttons are displayed by a DBNavigator (not the hacked one) through its VisibleButtons property. Another property whose default value you may want to change is Hints- use it to supply Help Hints of your choosing for the individual navigator button. You can control the display of the Hints by editing the ShowHints property. Thats it. This is why youve picked Delphi! Gimme More! Why stop here? You know that when you click the nbNext button the datasets current position is advanced to the next record. What if you want to move, lets say, 5 records ahead if the user is holding the CTRL key while pressing the button? How about that?à The standard DBNavigator does not have the OnMouseUp event- the one that carries the Shift parameter of the TShiftState- enabling you to test for the state of the Alt, Ctrl, and Shift keys. The DBNavigator only provides the OnClick event for you to handle.à However, the THackDBNavigator can simply expose the OnMouseUp event and enable you to see the state of the control keys and even the position of the cursor above the particular button when clicked! Ctrl Click : 5 Rows Ahead To expose the OnMouseUp you simply assign your custom event handling procedure to the OnMouseUp event for the button of the hacked DBNavigator. This exactly is already done in the SetupHackedNavigator procedure:OnMouseUp : HackNavMouseUp; Now, the HackNavMouseUp procedure could look like: procedure TForm1.HackNavMouseUp (Sender:TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);const MoveBy : integer 5;beginif NOT (Sender is TNavButton) then Exit; case TNavButton(Sender).Index of nbPrior: if (ssCtrl in Shift) then TDBNavigator(TNavButton(Sender).Parent). DataSource.DataSet.MoveBy(-MoveBy); nbNext: if (ssCtrl in Shift) then TDBNavigator(TNavButton(Sender).Parent). DataSource.DataSet.MoveBy(MoveBy); end; end;(*HackNavMouseUp*) Note that you need to add the signature of the HackNavMouseUp procedure inside the private part of the form declaration (near the declaration of the SetupHackedNavigator procedure): type TForm1 class(TForm) ... privateprocedure SetupHackedNavigator(const Navigator : TDBNavigator; const Glyphs : TImageList); procedure HackNavMouseUp(Sender:TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); ... Ok, lets explain, one more time. The HackNavMouseUp procedure handles the OnMouseUp event for each DBNavigator button. If the user is holding the CTRL key while clicking the nbNext button, the current record for the linked dataset is moved MoveBy (defined as constant with the value of 5) records ahead. What? Overcomplicated? Yep. You do not need to mess with all this if you only need to check the state of the control keys when the button was clicked. Heres how to do the same in the ordinary OnClick event of the ordinary DBNavigator: procedure TForm1.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn); function CtrlDown : Boolean; var State : TKeyboardState; begin GetKeyboardState(State); Result : ((State[vk_Control] And 128) 0); end;const MoveBy : integer 5;begincase Button of nbPrior: if CtrlDown then DBNavigator1.DataSource.DataSet.MoveBy(-MoveBy); nbNext: if CtrlDown then DBNavigator1.DataSource.DataSet.MoveBy(MoveBy); end; //caseend;(*DBNavigator2Click*) Thats All Folks And finally, the project is done.à Or you can keep going.à Heres a scenario/task/idea for you:à Lets say you want only one button to replace the nbFirst, nbPrevious, nbNext, and nbLast buttons. You can use the X, and Y parameters inside the HackNavMouseUp procedure to find the position of the cursor when the button was released. Now, to this one button (to rule them all) you can attach a picture that has 4 areas, each area is suppose to mimic one of the buttons you are replacing ... got the point?
Subscribe to:
Posts (Atom)