Part of Templates and the Application Generator: the hub. 111 entries under this heading; every entry opens as its own topic.
- How do I get XP-style buttons and caption bars in a Clarion application? - For XP-style buttons and caption bars, check Include Default XP Manifest in the AppGen global properties; the colors come from the user's XP scheme.
- A template prompt cannot list the fields of a chosen list or combo control (#FIX missing) - A #BUTTON FROM(%ControlField) lists nothing until a #PREPARE block runs #FIX on the control chosen in the #PROMPT; that statement was missing.
- DropCombo "More Field Assignments" keeps the ID of the first selection - A drop combo's More Field Assignments kept the first selection's ID; the poster had put the wrong field in the additional field line, so check that first.
- Which Frame embed point should enable or disable a menu item as procedures open and close? - Drive the Frame menu item from TakeEvent (post an event to the Frame from child threads), a Frame timer event, or ThisWindow.Reset; the poster did not report which he kept.
- A control template dropped on a toolbar panel lands under the toolbar and is invisible - A control template dropped on a toolbar panel landed under the toolbar; placing it on the window first and dragging it to the toolbar worked.
- Disabled entry controls are not dimmed (grayed) in a window - Disabled entry fields do not gray by themselves; set the background to a light gray or BtnFace color together with PROP:Disable in a helper.
- Presetting the selected item of a droplist in an H5 window procedure - Preset a droplist by assigning its local variable the value, and check the filedrop template's value-assigning prompt is completed; works the same in Windows and H5 mode per one poster.
- Closing the parent window when a child window is opened from an embed (Reported, not reproduced) - Closing a parent from the Kill embed left it open until the child closed; MODAL child blocked image windows; LoseFocus/GainFocus POST was suggested, with no outcome reported.
- How to stop a window from being resized below a minimum size (OnResize SETPOSITION does not work) - Use PROP:MinWidth and MinHeight instead of GETPOSITION/SETPOSITION, set on the MDI frame (reachable through a global WINDOW reference) when child windows are maximized.
- The option's Accepted embed does not run when the user clicks the radio button that is already selected - Accepted is generated only when the option value changes, so clicking the already selected radio fires nothing; PROP:Touched, a back-out radio or an OK button were used.
- A COMBO that completes and moves on after one typed letter, without pressing Tab - Give the COMBO the IMM attribute and test KEYCHAR() in the NewSelection event to act on a typed letter and move on without Tab.
- A form with six tabs opens on tab 4 instead of tab 1 - A form opened on tab 4 because a copied window definition duplicated the first-field STRING; the compiler warning "duplicated, using second" gave it away.
- A browse window that starts small and grows when the user clicks an Expand button - Design the window at full size, hide the extra controls, and have an Expand button toggle their hide state and the window width in code, or move fields with XPos and YPos.
- Simulating a push button click from code (and why calling its procedure in a loop hung the app) - POST(EVENT:Accepted) to the button control simulates the click; calling its procedure from a Process procedure or a CSV loop hung the application.
- An OCX event callback adds to a queue but the window shows the rows only after the OCX method returns - An OCX callback's queue rows appeared only after the method returned; calling the threaded variant of the OCX method fixed it, and module-scope data or a generated class were other options.
- Using the DOSFileLookup control template to let the user pick a folder, or a place to create a new file - Set the DOSFileLookup dialog type to Directory, or add FILE:Directory to the lookup object's Flags in the Init embed, or use FILEDIALOG with the directory flag.
- List box formatter: "The specified format is invalid" and only the first column shows - A list box FORMAT string with an embedded tooltip made the formatter say the format is invalid; removing that tooltip part let it open.
- Hiding the menu bar on a Frame: PROP:Hide on the MENUBAR does nothing - Hiding the menu bar on a Frame had no effect until every individual menu was hidden first, then the bar; PROP:YesSheet was suggested for covering it.
- DOSFileLookup does not start in the default directory (or remember the last one) on every computer - Set the DOSFileLookup object's DefaultDirectory in code, or save and set the path around FILEDIALOG, or hand-code the dialog instead of using the template.
- EVENT:Accepted never fires on the OK and Cancel buttons of a window procedure - Buttons with the STD:Close attribute never fire Event:Accepted; remove it, set the value in the Accepted embed, then POST(EVENT:CloseWindow), or catch EVENT:CloseWindow in TakeWindowEvent.
- A third-party OCX report control does not appear on the client's machine (Noyantis Report Control, RegFree COM) - A third-party OCX control missing on a client PC worked after copying both generated RegFree manifest files with the exe and keeping the OCX in the exe folder.
- FileDropCombo TakeAccepted fires twice, once for the FEQ and once for FEQ+1000: what are the extra controls? - A FileDropCombo is three controls: the design-time FEQ is the entry field, FEQ+1000 the list box, FEQ+2000 the drop button, so TakeAccepted fires for each.
- A LIST or REGION on a SHEET tab does not work as a drop target (DROPID ~FILE) (Reported, not reproduced) - A list or region on a sheet tab did not take file drops; moving the list off the sheet and hiding it per tab worked for the poster; API route suggested.
- Refreshing a browse on window B from a button on window A (inter-window communication) - Use NOTIFY from the first window and NOTIFICATION in the second to refresh its browse, or post a custom user event.
- H5 web app: a "Please Wait" window that sends an email never closes - In H5 the server cannot tell the client the window closed; set a refresh timer with SetTimeOut and close on a flag, or add an OK button.
- Changing the order of entry fields on a generated form (tab order, including controls on a tab) - In the window formatter press F12 and reorder the fields with the up and down keys, multi-select works; Set Tab Order failed for controls on a tab.
- File lookup dialog shows no mapped network folders for some Windows 8.1 users - A file dialog showing no mapped network folders was explained by Explorer running as another (admin) user than the app; check the user context.
- How do I switch off the maximize option of a browse window (and fix its size)? - Uncheck Maximize Box in the window properties, or set 0{PROP:Max} = FALSE after opening; use a double frame to fix the size.
- Where do I find and add the DOSFileLookup control template? - DOSFileLookup is a shipped ABC control template: drag it from the Control Template pad in the Window Designer onto the window and set options via Actions.
- Running code on every keystroke in an entry control: the All Events embed is not reached - Put per-keystroke code in the entry's NewSelection embed with IMM set; read the typed text with UPDATE on the control or its ScreenText property.
- A resizable split bar between two list boxes: is there a free template? - A free ABC split bar template with OOP code usable in Legacy was posted, and a commercial resize and split tool was recommended.
- How do I force focus to a particular tab on a sheet? - Assign the tab's field equate to the sheet's PROP:ChoiceFEQ; the poster's code failed only because it sat in a RADIO button's Accepted embed.
- Bring an existing window of the program to the foreground over other applications - Call the Windows API SetWindowPos() on the window instead of posting EVENT:GAINFOCUS; a Clarion Foundry article was named as the code source.
- Putting a gradient fill on a BOX control from an embed - Set PROP:GradientFromColor, GradientToColor and GradientType on the BOX in the OpenWindow embed after generated code; a JPG makes smaller screenshots than PNG.
- The DOSFileLookup button does nothing on a non-MDI window (Reported, not reproduced) - DOSFileLookup and raw FILEDIALOG did nothing on a non-MDI window; posters suggested checks of file name, CommDlgExtendedError, manifest and hooks, no cause found.
- Windows open off screen because a saved negative XPos or YPos is restored - Windows saved at negative positions open off screen; Cascade or Tile resets them, WinEvent's Make Windows Visible keeps them on screen, or fix positions in the INI class Fetch method.
- How do I let the user pick a color and store it, and show a preview? - Store the picked color in a LONG passed to COLORDIALOG, assign it to PROP:COLOR, and show a preview by changing the fill of a BOX control.
- A window looks right in the designer and preview but icons, fields and lines are moved at runtime - A window distorted at runtime was changed by the resize class that the Window wizard had added; remove it or set custom resize per control.
- Password-protecting some tabs of a sheet: the contents show before the password is asked - Neither sheet embed fit, because Tab Changing still reports the old tab; hide the protected tab's controls and unhide them after the password is accepted.
- A LIST with a MARK field shows the entry highlighted but the queue field is false - The list MARK field stayed false although entries were highlighted; use your own marking field or a copy queue with a style field instead.
- Closing the application automatically when Windows shuts down - To close an app when Windows shuts down, use the free ABC Free third-party templates; CapeSoft WinEvent was named as the paid alternative.
- An OCX on a window: properties work, method calls fail, and how to receive its events - OCX method calls failed because the Clarion ampersand was in the command text; build the string first, enable PROP:ReportException, and register an event callback.
- Pre-filling an entry control with grey hint text such as "Last Name" (placeholder) - Grey hint text in an entry is a placeholder: the Ultimate Placeholder template, or the Windows cue banner on a TEXT,SINGLE control only.
- DOS File Lookup template: a file mask that shows only numeric extensions (*.000 to *.999) - The DOS File Lookup mask cannot match digits only; change the mask at run time with SetMask, or use FILEDIALOG and delete non-numeric names from its queue.
- A small pop-up window to ask the user for a value (an InputBox) - To ask the user for a value, build a small window procedure with a prompt and entry field; other posters named a FAQ routine and the Nova templates.
- Turning a string into a clickable link, like an HTML hyperlink - A string can become a clickable link with the CapeSoft Hyperlink product or a free Internet Link template; its virtual methods can be overridden to run an embed.
- A LIST shows the wrong fields in its columns and some columns stay empty (AutoNumberField and STYLE) - List columns showed wrong or missing fields because style was checked per column; add a LONG style field after each queue field, or turn AutoNumberField off.
- Rows with a PROPLIST:Style do not resize their text when the window resizes - Resize the text of styled list rows by setting the style's font size with the PROPSTYLE:FontSize property per style number.
- Starting a timer on a form and turning it off from the Timer event (0{Prop:Timer}) - Set 0{Prop:Timer} to 0 in the Timer event, and start it with a value in Init or a button's Accepted embed; re-arm only while work remains.
- Embed code on RADIO buttons runs, but the round indicator does not turn on - RADIO embeds ran but the indicators stayed off; putting the code in the OPTION control's events made the radios turn on and off properly.
- SELECT(?Control) in an embed does not give the control focus when a maximized window opens - SELECT in the EVENT:OpenWindow embed after generated source; if focus is stolen late, use a one-shot timer or a flag; one poster needed more.
- Treating an address maintenance form as a reusable piece inside other forms (form-inside-a-form) - To reuse an address maintenance piece inside other forms, replies pointed to the user control feature (a region run by another procedure) or a control template.
- cwHH help template: the help ID on a tab shows the main window's help instead - The cwHH help template ignores a tab's help ID; change the topic in the sheet's NewSelection embed, or use native CHM help with tilde and .htm IDs.
- A group of controls no longer resizes with the window (resize template) - A group that stopped resizing with the resize template was caused by touching or overlapping controls; moving them apart fixed it, and one poster sized one control from the other by hand.
- Catching the F1 key press on a window to log it, while the help file still opens - F1 can be remapped with ALIAS and an alert, then the HELP statement called, or the window subclassed and WM_HELP tested instead of WM_KEYUP once a help file is set.
- CHM help through the help global extension: context numbers do not work, topic IDs do - With the CHM help global extension use TopicIDs rather than context numbers; F12 is the trapped help key and can be changed on the extension.
- Forcing Event:Accepted on a RADIO control when the user tabs past it without changing it - To run Accepted on a radio group when the user tabs past it, alert the tab key on the radios and post Accepted for the option from the AlertKey event.
- Selecting the whole text of an entry field when the user clicks into it with the mouse - Clicking into an entry field with the mouse does not select all the text as tabbing does; replies offered double-click or SELECT, no select-all on click was found.
- F1 does not open the right topic: what to type in the Help ID prompt for a CHM topic - Type a tilde followed by the authoring tool's topic ID in the Help ID prompt, not the context number, so F1 opens the CHM topic.
- Jumping to an anchor inside a help topic: the Help ID gets ".htm" appended - The Append .HTM to Help IDs option breaks anchors; turn it off and write the topic with .htm and the anchor yourself, or use the bang variable form.
- A window saved in the INI always opens at the far right for one customer (Reported, not reproduced) - One customer's saved window kept opening at the far right after the INI was deleted; posters asked questions and guessed at a shared INI, no outcome.
- Hiding a window while a started process runs: the LoseFocus and GainFocus embeds are not always called - Hide the parent from the started procedure with SETTARGET on its thread, or post events to the parent; a hidden parent gets no events.
- Tree list without a control template: which row was expanded or contracted, to switch its open/closed icon - In the Expanded and Contracted events read PROPLIST:MouseDownRow, GET that queue row, change its icon and level, PUT it; alert the plus and minus keys to post the events.
- Playing a WAV sound from a Clarion program without adding a template - Prototype the Windows PlaySoundA call in the MAP and call it with a CSTRING file name and the async filename flag; a tiny separate EXE is safer.
- Legacy template chain: the window appears, then jumps to its last saved position - A Legacy window jumps because setup code runs before the INI restore; remove early DISPLAY calls, or hide the window after OPEN and unhide it in EVENT:OpenWindow.
- The sheet's TabChanging embed does not fire - The sheet TabChanging embed did not fire with XP themes; use the sheet TakeNewSelection embed instead, or set Immediate and remember the code runs for the tab left.
- Creating an Outlook e-mail from Clarion with OLE (no template) - Create the Outlook.Application OLE object, call createItem(0), set subject, to and body, then display or send; Outlook only, and send puts mail in the Outbox.
- Replacing the default Windows title bar with a custom caption (photo, buttons) - Replace the title bar with a region you drag by hand, CapeSoft Draw, or a Clarion Metro caption template; the metro template may need project settings in multi-DLL apps.
- Right-click on a TEXT box shows a popup with Unicode options: where does it come from and how do I add to it? - The text box popup comes from the runtime library; alert the right-click, call your own POPUP in Event:Alert and CYCLE in Event:PreAlert.
- An RTF file saved from Word shows only the embedded RTF or nothing in the text control - An RTF file saved by Word did not display in the RTF text control; opening it in WordPad and saving again gave a smaller file that worked.
- cwHH help: F1 or the help button shows the hourglass for a few seconds, then nothing opens - The cwHH help showing only an hourglass usually means the CHM is not found; set the default help file name, Append .HTM, and match topic IDs.
- Entry fields beside a hand-filled list box do not update when the user scrolls - In a hand-filled list, GET the queue record with CHOICE in the new selection event and DISPLAY, or add the AUTO attribute to the window.
- Changing the Insert, Change and Delete actions of a form at run time for user rights (extension template) - Restrict insert, change and delete at the browse (its ASK method, or disabling the buttons and zeroing the browse control properties in Init), not in the form.
- The pie chart does not draw after converting an app: the boxes and legend show, no pie - A pie that did not draw after conversion had no data because the table feeding the slices was not open; check the code runs after the window opens.
- Which embed runs a routine when any radio button of an option is selected, and can a radio be unselected? - Use the option control's Accepted event and CASE on its use variable or ChoiceFEQ; clear a selection with an extra default radio or PROP:Selected set to -1.
- Creating a variable number of controls dynamically on an H5 web form - On an H5 form CREATE must run before the web window is initialised; simpler is to build all controls, hide unused ones, or use a grid for child rows.
- Closing all open windows from a frame menu item while keeping the application frame open - Posting CloseDown to each thread closed only the last window; a global flag checked in every accept loop, cleared by a timer, closed all but the frame.
- Showing a status bar message on the frame while a browse loads, then clearing it - Set the frame status text before starting the procedure, then clear it by posting an event or NOTIFY to the frame thread.
- After adding the HTML help templates, creating an OCX at runtime with PROP:Create hangs the app (Reported, not reproduced) - With the HTML help templates added, creating an OCX at runtime with PROP:Create hung the app; licensing was ruled out, a threading cause was guessed, no fix found.
- One calendar button for all the date fields on a form instead of one CalendarButton template each - Use one CalendarButton instance and plain ellipsis buttons whose Accepted code calls the calendar class Ask method for each date field; none of it was tested.
- A button that opens a menu with an icon on each item, placed right below the button - Use POPUP in a button's embed with icon items; set its position parameter to 1 or convert coordinates with ClientToScreen so the menu opens below the button.
- Maximizing the MDI app frame makes it flicker for seconds, freeze and sometimes close (WinEvent) - A maximized MDI frame flickered and froze with WinEvent 5.22 and 5.23; turning off Make visible on Desktop or disabling WinEvent on the frame stopped it.
- A control placed next to an entry field appears over it, or shifted away, at run time after moving to Clarion 6.3 - A control drifted over its entry field at run time in 6.3 because the resize class assumed a parent control; SetParentControl or build 9052 fixed it.
- A clock or time picker control like the Calendar control template, for entering a TIME - For a clock or time picker like the calendar template, posters named the SysDT picker, an analog clock example and the free ClockWithMouse template.
- Trapping the change of a time spin box so a second spin box can be raised by seven hours (Reported, not reproduced) - Trapping a time spin box change to raise a second one: NewSelection, TakeEvent code and DISPLAY were suggested, none confirmed on a report window.
- Knowing whether the user selected a file in the ABC File Lookup control template, as with a hand-coded FILEDIALOG - Give the file lookup a variable and test it for a value; clear it before each lookup and check the Return Default on Cancel box.
- Which Clarion 6.3 template looks up a DOS file or directory from a button? - Use the DOS File Lookup control template, or a button whose TakeAccepted embed calls FILEDIALOG with the flags for a file, a directory or both.
- EVENT:GainFocus does not fire when switching between maximized MDI windows (Reported, not reproduced) - GainFocus embed code never ran when switching between two maximized MDI windows; the Toolbox attribute was suggested and ruled out, no cause found.
- HTML Help with the F1 key in a Clarion 5 app: ALIAS/ALERT hangs, and the HTML Help template says it was compiled for 5b - Catch F1 for HTML Help by checking for WM_HELP in a window subclass, since keystrokes are not delivered; HTML Help arrived with Clarion 5.5 and the template error text misleads.
- DISABLE or PROP:Enabled on a control from a radio button embed does nothing - Use DISABLE(?Field) with the question mark, not PROP:Enabled, and put the code in the OPTION's Accepted embed because a RADIO gets Selected only.
- How do I call the standard Print Setup dialog (STD:PrintSetup) from my own embed code? - Call PrinterDialog(,1) in the embed to open the printer setup, or use a hidden button with the standard action and post an accepted event to it.
- Preventing Event:Dragging so a drag-and-drop is conditional - Stop a drag by setting the control's drag or drop id to empty when no drag is wanted; the ids are arrays, so use an index.
- Resizing windows and their controls when the windows have no title bar - Resize a title-less window in code from the frame size, use a resize template with an initial Full resize, or start the main frame at normal size.
- EVENT:Sized is called many times during one window resize - Do not rely on the sized event; compare the window size from GETPOSITION with the saved size on every event and run the resize code on change.
- Clarion 9 renames ?List to ?List:7 when the window is edited (Reported, not reproduced) - A converted window had ?List renamed to ?List:7 on edit; nobody explained it, posters advise unique meaningful control names before writing hand code.
- Keeping a window or the app frame always on top - Use Windows API example code, a free ABC templates function, or the paid CapeSoft WinEvent feature; one poster saw different behaviour on XP.
- Google Maps in a Shell.Explorer.2 OLE control says "The Google Maps Embed API must be used in an iframe" - Set the FEATURE_BROWSER_EMULATION registry value for the executable at startup, or load the map from a local HTML file with an iframe.
- Selecting a browse list and its first record automatically when a tab is selected - Select a list when a tab is chosen from a sheet-level embed after the parent call, testing the sheet's ChoiceFEQ.
- A STRING(1) field behind a check box holds '0' for false after converting from C5 to C5.5 - Only an empty string is false, so a STRING(1) check box needs a BYTE, or a true value of 1 with an empty false value.
- PROP:Wizard shown with MESSAGE is blank instead of 1 on a SHEET with the Wizard option set (Reported, not reproduced) - PROP:Wizard of a sheet with the Wizard option set showed blank instead of 1; the USE variable type and the question mark were discussed, no answer.
- MDI app: maximising a window resizes the frame but not the controls of a covered window on another thread (Reported, not reproduced) - Controls of a covered window on another thread did not resize when maximised; posting EVENT:Sized to that thread and the debugger were suggested, no outcome.
- Event:Accepted never fires on a window with a single entry control, so the POST(EVENT:CloseWindow) in its embed does nothing - Event:Accepted fires only when focus moves to another control, so add a second focusable control, such as a hidden dummy entry, to the window.
- Giving an existing Clarion 6.3 application a modern (Vista) look without rewriting the browses and forms - Makeover and AnyFont restyle an existing app without moving controls; Noyantis templates add ribbons and skins but also need the Codejock ActiveX controls.
- A STRING control on a popup window opened from a browse shows nothing - A STRING control on a hand-coded popup showed nothing from its USE variable; assigning PROP:Text once the window had opened worked for the poster.
- Two windows open maximized every time although set to design size (Reported, not reproduced) - Two windows kept opening maximized despite design size and save-restore turned off; resize templates, TXA reimport and the INI file showed no cause.
- Saving and restoring window positions in a legacy app: INI file or registry, and where to put the INI file? - Use the standard template; PUTINI and GETINI without a path go to a user VirtualStore folder on Vista; a Vista-aware INI manager article was named.
- A TIP added to a REGION is removed when the window is opened again in the designer - The designer drops a TIP typed on a region; set it in code with the region's PROP:Tip or use a third-party tooltip template.
- Changing the tab order of entry controls at runtime (skip a field in Change mode) - Change the order with PROP:Follows and PROP:NextField, or set PROP:Touched on the control in its Selected or TakeSelected embed so Accepted fires.
- FileDropCombo: empty list, typed text resets to blank, and the add-record prompt appears twice - Adding an Update Procedure to the FileDropCombo that contains only RETURN made the combo accept a typed new entry for the poster.
- Controlling WinFax from a Clarion 5.5 ABC app through COM instead of DDE - WinFax can be driven through its SDK objects defined as an OLE control; a second send failed when unimodem support was installed.
- Enter=Tab on a TEXT field completes the form instead of moving to the next field - Enter=Tab on a TEXT field completes the form; raising the ABCFree text box line height prompt made Enter move on, or use the DOS-style Enter template.