Tuesday, March 17, 2020

F. Scott Fitzgerald - A Timeless Writer Who Was a Man of His Time essays

F. Scott Fitzgerald - A Timeless Writer Who Was a Man of His Time essays F. Scott Fitzgerald is best known today as the author of the classic novel The Great Gatsby. The novel tells the story of Jay Gatsby, a poor and obscure Midwesterner who makes his fortune as a bootlegger to win the heart of his childhood sweetheart. One character says of Gatsby that he made himself up, in other words, that through creating a false personal mythology, by wearing fancy clothes, and buying fancy houses, Gatsby unsuccessfully tried to create a new identity for himself. The same could have been said of his creator, although unlike Gatsby, Fitzgerald had a far more ironic view of the world as a writer. He ironically chronicled Ivy League and elite Long Island society observed with wonder by the narrator of Fitzgeralds greatest book. Fitzgerald was born in the American heartland, in St. Paul Minnesota on September 24, 1896. His father Edward Fitzgerald was a failed furniture salesman and his mother Mary was an Irish immigrant. (Willet, 2006) Both were Catholic and thanks to his mothers inheritance, solidly middle-class, although it is said his father drank more at the office than he worked. The young Fitzgerald excelled as a writer at the Catholic school where he studied, but always felt somewhat out of his social element because of his mothers Irish birth when he ventured into the realms of the real St. Paul elite, such as at his local dancing school. (Martine, 1981, p.3) Fitzgerald got into Princeton but he was not particularly studious. He struggled academically. He wrote for the Princeton Triangle Club musicals, the Princeton Tiger humor magazine and the Nassau Literary Magazine. He was placed on academic probation. As he was unlikely to graduate he eventually dropped out of school to join the army. (Bruccoli, 1994) When the army stationed him near Montgomery, Alabama in 1918, Scott met and fell in love Zelda, who was later to become his wife. When he later proposed, Zelda initially rebuffed Fi...

Sunday, March 1, 2020

How to Display Menu Item Hints in Delphi Applications

How to Display Menu Item Hints in Delphi Applications Use specific coding language to program Delphi applications to display a hint, or tooltip, when the mouse hovers over a menu component. If the ShowHint property is set to true and you add text to the hint property, this message will be displayed when the mouse is placed over the component (a TButton, for example). Enable Hints for Menu Items Because of the way Windows is designed, even if you set the value for the hint property to a menu item, the popup hint will not get displayed. However, the Windows start menu items do display hints. The favorites menu in Internet Explorer also displays menu item hints. It is possible to use the OnHint event of the global application variable in Delphi applications to display menu item hints in a status bar. Windows does not expose the messages needed to support a traditional OnMouseEnter event. However, the WM_MENUSELECT message is sent when the user selects a menu item. The WM_MENUSELECT implementation of the TCustomForm (ancestor of the TForm) sets the menu item hint to Application.Hint so it can be used in the Application.OnHint event. If you want to add menu item popup hints (tooltips) to your Delphi application menus, focus on the WM_MenuSelect message. Popup Hints Since you cannot rely on the Application.ActivateHint method to display the hint window for menu items (as menu handling is completely done by Windows), to get the hint window displayed you must create your own version of the hint window by deriving a new class from the THintWindow. Heres how to create a TMenuItemHint class. This is a hint widow that actually gets displayed for menu items! First, you need to handle the WM_MENUSELECT Windows message: type TForm1 class(TForm) ... private procedure WMMenuSelect(var Msg: TWMMenuSelect) ; message WM_MENUSELECT; end...implementation...procedure TForm1.WMMenuSelect(var Msg: TWMMenuSelect) ;var  Ã‚  menuItem : TMenuItem;  Ã‚  hSubMenu : HMENU;begin inherited; // from TCustomForm (so that Application.Hint is assigned) menuItem : nil; if (Msg.MenuFlag $FFFF) or (Msg.IDItem 0) then begin if Msg.MenuFlag and MF_POPUP MF_POPUP then begin hSubMenu : GetSubMenu(Msg.Menu, Msg.IDItem) ; menuItem : Self.Menu.FindItem(hSubMenu, fkHandle) ; end else begin menuItem : Self.Menu.FindItem(Msg.IDItem, fkCommand) ; end; end;  Ã‚  miHint.DoActivateHint(menuItem) ;end; (*WMMenuSelect*) Quick info: the WM_MENUSELECT message is sent to a menus owner window when the user selects (but does not click) a menu item. Using the FindItem method of the TMenu class, you can get the menu item currently selected. Parameters of the FindItem function relate to the properties of the message received. Once we know what menu item the mouse is over, we call the DoActivateHint method of the TMenuItemHint class. The miHint variable is defined as var miHint : TMenuItemHint and is created in the Forms OnCreate event handler. Now, whats left is the implementation of the TMenuItemHint class. Heres the interface part: TMenuItemHint class(THintWindow)private activeMenuItem : TMenuItem; showTimer : TTimer; hideTimer : TTimer; procedure HideTime(Sender : TObject) ; procedure ShowTime(Sender : TObject) ;public constructor Create(AOwner : TComponent) ; override; procedure DoActivateHint(menuItem : TMenuItem) ; destructor Destroy; override;end; Basically, the DoActivateHint function calls the ActivateHint method of the THintWindow using the TMenuItems Hint property (if it is assigned). The showTimer is used to ensure that the HintPause of the Application elapses before the hint is displayed. The hideTimer uses Application.HintHidePause to hide the hint window after a specified interval. Using Menu Item Hints While some might say that it is not a good design to display hints for menu items, there are situations where actually displaying menu item hints is much better than using a status bar. A most recently used (MRU) menu item list is one such case. A custom taskbar menu is another.