GettingStartedMDL.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 /************************************************************************************/
15 /************************************************************************************/
120 /************************************************************************************/
136 /************************************************************************************/
165 /************************************************************************************/
180 /************************************************************************************/
205 /************************************************************************************/
210 /************************************************************************************/
235 /************************************************************************************/
869 /************************************************************************************/
972 /************************************************************************************/
1071 /************************************************************************************/
1153 /************************************************************************************/
1161 /************************************************************************************/
1181 /************************************************************************************/
1365 /************************************************************************************/
1462 /************************************************************************************/
1667 /************************************************************************************/
1753 /************************************************************************************/
1936 /************************************************************************************/
2184 /************************************************************************************/
2220 /************************************************************************************/
2325 *
2326 * @endcode
2327 *
2328 *<H4>CONNECT Edition</H4>
2329 * @code{.unparsed}
2330 * #include <Mstn\MdlApi\rsctext.r.h>
2331 
2332  #if defined (resource)
2333  @AspectRatio ASPECT_DEFINEACSBYELEMENT = 1.0; /* ICONCMDID_DefineACSByElement */
2334  #endif
2335 *
2336 * @endcode
2337 *
2338 *<H2>MSValueDescr in Hook Messages </H2>
2339 *<P>The MSValueDescr struct has been introduced and is a C++ wrapper for the older ValueDescr struct introduced in V8. The MSValueDescr struct contains the data type and the value and also has methods that operate on that value. The struct is defined in <Mstn\MdlApi\MSValueDescr.h>. Any existing usages of ValueDescr, or any combination of a format type plus a ValueUnion, should be replaced with an MSValueDescr. Any functions that took a ValueDescr* should now take a MSValueDescrP. </P>
2340 *
2341 *<P>The data types supported by MSValueDescr include: </P>
2342 *<UL>
2343 * <LI>signed/unsigned 16, 32, 64 bit integers </LI>
2344  <LI>double </LI>
2345  <LI>WChar </LI>
2346  <LI>void* and data size </LI>
2347  <LI>Byte </LI>
2348  <LI>bool </LI>
2349 *</UL>
2350 *
2351 *<P>MSValueDescr has multiple constructors which take specific data types. There are also copy methods and an = operator. There are numerous "Is", "Get", "Set" and "Compare" methods. Some of the "Get" methods will perform necessary numeric conversions, but will complain about signed/unsigned mismatches and possible data loss. </P>
2352 *
2353 * @note The FMT_STRING formatType and support for multi-byte values have been removed.
2354 *
2355 *<H3>MSValueDescr - Example Hook Message Change </H3>
2356 *<P>Any instance of ValueDescr or a formatType/ValueUnion combination has been replaced by an MSValueDescrP in the dialog hook and dialog item hook message structs, which are defined in <Mstn\MdlApi\dlogitem.h>. As an example, here is the old DialogItemMessage.u.value followed by the new version. Note that the following variables in the 8.11 version have been replaced by a single MSValueDescrP in the CONNECT Edition: </P>
2357 *<UL>
2358 * <LI>int formatType </LI>
2359  <LI>ValueUnion value </LI>
2360  <LI>char* stringValueP </LI>
2361  <LI>void* and data size </LI>
2362  <LI>int maxStringSize </LI>
2363  <LI>int voidDataSize </LI>
2364 *</UL>
2365 *
2366 *<H4>8.11 </H4>
2367 * @code{.unparsed}
2368 * struct /* used by GETSTATE, SETSTATE, GETVALUE, SETVALUE */
2369  {
2370  BoolInt hookHandled; /* <= only for hooks,TRUE if handled */
2371  BoolInt valueChanged; /* <= on SET's if value changed */
2372  int formatType; /* defined in vartypes.h */
2373  ValueUnion value;
2374 
2375  char* stringValueP; /* only if string */
2376  char* formatStrP; /* only if string */
2377  int maxStringSize; /* only if string & GETs */
2378 
2379  char* accessStrP; /* in case an item has more than one access string */
2380  int voidDataSize; /* if void pointer is being passed in ValueUnion */
2381 
2382  BoolInt cancelled; /* <= on SETSTATE, will prevent the following QUEUECOMMAND */
2383  } value;
2384 *
2385 * @endcode
2386 *
2387 *<H4>CONNECT Edition</H4>
2388 * @code{.unparsed}
2389 * /*----------------------------------------------------------------------+
2390  DITEM_MESSAGE_GETSTATE & DITEM_MESSAGE_SETSTATE
2391  DITEM_MESSAGE_GETVALUE & DITEM_MESSAGE_SETVALUE
2392  DITEM_MESSAGE_JOURNALSTATE
2393  +----------------------------------------------------------------------*/
2394  struct DialogItemValueArgs
2395  {
2396  bool hookHandled; // <= for STATE messages, true if handled
2397  MSValueDescrP msValueDescrP; // <> includes formatType, string, numeric & ptr values
2398  CharP accessStrP; // => in case an item has more than one access string
2399 
2400  // GET messages
2401  WCharCP formatStrP; // => only if string
2402 
2403  // SET messages
2404  bool valueChanged; // <= on SET's if value changed
2405  bool cancelled; // <= on SETSTATE, prevent the following QUEUECOMMAND
2406  };
2407 *
2408 * @endcode
2409 *
2410 *<H3>MSValueDescr - Example Usages </H3>
2411 *<P>Here are some example usages showing MSValueDescr "Get" and "Set" calls: </P>
2412 *
2413 * @code{.unparsed}
2414 * // GetLong
2415  long iValue;
2416  iValue = dimP->u.value.msValueDescrP->GetLong();
2417 
2418  // SetLong
2419  long index = 100;
2420  dimP->u.value.msValueDescrP->SetLong (index);
2421 
2422  // GetWString
2423  WString wMyString;
2424  dimP->u.value.msValueDescrP->GetWString (wMyString);
2425 
2426  // GetWCharCP
2427  WCharCP itemString = dimP->u.focusOut.msValueDescrP->GetWCharCP ();
2428 
2429  // GetWChar
2430  WChar sBuffer[256] = {0};
2431  dimP->u.value.msValueDescrP->GetWChar (sBuffer, _countof(sBuffer));
2432 
2433  // SetWChar
2434  WString wMyString(L"Hello World!");
2435  dimP->u.value.msValueDescrP->SetWChar (wMyString.c_str());
2436 *
2437 * @endcode
2438 *
2439 *<H2>What Is New? </H2>
2440 *<P>A few "major" features have been added in the CONNECT Edition PowerPlatform and these are explained in dedicated sections below. </P>
2441 *
2442 *<UL>
2443 * <LI>C++ APIs </LI>
2444  <LI>C++ Hook Handlers </LI>
2445  <LI>MDL Layout Manager </LI>
2446  <LI>WPF Support </LI>
2447  <LI>Telerik Controls - WPF & WinForms</LI>
2448 *</UL>
2449 *
2450 *<P>Other features have also been added, including Double-Buffering, Color Schemes and New Dialog Items. </P>
2451 *
2452 *<H3>Double-Buffering for MDL Windows </H3>
2453 *<P>Double-buffering has been added for MDL windows and dialogs, which greatly reduces any flickering, or "flishy-flashy", behavior. This feature is free - there is nothing extra you must do to turn this feature on. However, if you're doing some Generic dialog item drawing or GDI/GDI+ drawing into the window and there is still some flickering, an mdlWindow_doubleBuffer* API is available and is prototyped in <Mstn\MdlApi\mswindow.fdf>. There is also a GuiDoubleBufferRef helper class that wraps some of those C functions. </P>
2454 *
2455 *<H3>Color Schemes </H3>
2456 *<P>Some color schemes have been introduced that mimic the Office 2007 Silver, Blue and Black (Dark Gray) themes. This can be set via "Workspace menu > Preferences > Look and Feel". More color themes will be added and we will work on applying those themes across MDL, WinForms and WPF windows and controls. </P>
2457 *
2458 *<H3>New Dialog Items / Controls </H3>
2459 *<P>A couple of new dialog items have been added: </P>
2460 *<UL>
2461 * <LI>CompactSlider control for Visualization team </LI>
2462  <LI>FlowDocumentScrollViewer control for formatted text - wraps a WPF control </LI>
2463 *</UL>
2464 *
2465 *<H3>C++ APIs </H3>
2466 *<P>C++ APIs for the MSDialog, MSWindow and DialogItem structs and various dialog items have been introduced. These APIs will help those C++ developers who want a more object-oriented application and also those who are using Visual Studio IntelliSense. Adoption of the C++ APIs is optional and they may be introduced into your code gradually. The equivalent mdlWindow and mdlDialog API functions will remain in place, and those functions are listed below in the Method/Function tables. Not all of the dialog items have a C++ API, and we are evaluating the cost-benefit ratio to determine whether we should add more. </P>
2467 *
2468 *<H3>MSDialog </H3>
2469 *<P>The MSDialog struct is defined in <Mstn\MdlApi\MSDialog.h> and is a subclass of MSWindow. MSDialog is the new name for DialogBox and GuiDialog. The table below lists the MSDialog methods and the C-based mdlDialog functions they equate to. </P>
2470 *
2471 *<H3>Static/Class Methods </H3>
2472 *<table>
2473 * <tr>
2474 * <th>MSDialog Method </th>
2475 * <th>Equivalent mdlDialog Function</th>
2476 * </tr>
2477 * <tr>
2478 * <td>Find</td>
2479 * <td>mdlDialog_findByTypeAndId</td>
2480 * </tr>
2481 * <tr>
2482 * <td>Open</td>
2483 * <td>mdlDialog_openWithMD</td>
2484 * </tr>
2485 * <tr>
2486 * <td>OpenMessageBox</td>
2487 * <td>mdlDialog_openMessageBox</td>
2488 * </tr>
2489 * <tr>
2490 * <td>OpenModal</td>
2491 * <td>mdlDialog_openModalWithMD</td>
2492 * </tr>
2493 * <tr>
2494 * <td>QueueCommandNumber</td>
2495 * <td>mdlDialog_cmdNumQueueExt</td>
2496 * </tr>
2497 * </table>
2498 *
2499 *<H3>MSDialog Methods </H3>
2500 *<table>
2501  <tr><th>MSDialog Method</th>
2502  <th>Equivalent mdlDialog Function or Member</th>
2503  </tr>
2504 <tr>
2505 <td>AddHookHandler</td>
2506 <td>mdlDialog_addHookHandler</td>
2507 </tr>
2508 <tr>
2509 <td>Close</td>
2510 <td>mdlDialog_close</td>
2511 </tr>
2512 <tr>
2513 <td>CloseCommandQueue</td>
2514 <td>mdlDialog_closeCommandQueue</td>
2515 </tr>
2516 <tr>
2517 <td>FindItemAtPoint</td>
2518 <td>mdlDialog_findItemIndex</td>
2519 </tr>
2520 <tr>
2521 <td>GetCancelItem</td>
2522 <td>mdlDialog_itemGetCancel</td>
2523 </tr>
2524 <tr>
2525 <td>GetDefaultItem</td>
2526 <td>mdlDialog_itemGetDefault</td>
2527 </tr>
2528 <tr>
2529 <td>GetFontHeight</td>
2530 <td>fontHeight member or mdlDialog_fontGetHeight</td>
2531 </tr>
2532 <tr>
2533 <td>GetFontIndex</td>
2534 <td>mdlDialog_fontIndexGet</td>
2535 </tr>
2536 <tr>
2537 <td>GetFontInfo</td>
2538 <td>mdlDialog_fontGetInfo</td>
2539 </tr>
2540 <tr>
2541 <td>GetItemByIndex</td>
2542 <td>mdlDialog_itemGetByIndex</td>
2543 </tr>
2544 <tr>
2545 <td>GetItemByTypeAndId</td>
2546 <td>mdlDialog_itemGetByTypeAndIdEx</td>
2547 </tr>
2548 <tr>
2549 <td>GetItemPtrByTypeAndId</td>
2550 <td>GetItemByTypeAndId method &amp; DialogItem.GetTypePtr</td>
2551 </tr>
2552 <tr>
2553 <td>GetItemCount</td>
2554 <td>mdlDialog_itemsGetNumberOf</td>
2555 </tr>
2556 <tr>
2557 <td>GetLayoutHelper</td>
2558 <td>mdlDialog_getLayoutHelper</td>
2559 </tr>
2560 <tr>
2561 <td>GetOwnerMD</td>
2562 <td>mdlDialog_ownerMDGet</td>
2563 </tr>
2564 <tr>
2565 <td>GetResourceId</td>
2566 <td>mdlDialog_getResourceId</td>
2567 </tr>
2568 <tr>
2569 <td>GetRootRawItem</td>
2570 <td>mdlDialog_rItemRootGet</td>
2571 </tr>
2572 <tr>
2573 <td>GetStringWidth</td>
2574 <td>mdlDialog_stringWidth</td>
2575 </tr>
2576 <tr>
2577 <td>GetStringNWidth</td>
2578 <td>mdlDialog_stringnWidth</td>
2579 </tr>
2580 <tr>
2581 <td>GetUserData</td>
2582 <td>mdlDialog_userDataPtrGet</td>
2583 </tr>
2584 <tr>
2585 <td>HasFocus</td>
2586 <td>mdlDialog_hasFocus</td>
2587 </tr>
2588 <tr>
2589 <td>ItemSetEnabledByTypeAndId</td>
2590 <td>mdlDialog_itemSetEnabledByTypeAndId</td>
2591 </tr>
2592 <tr>
2593 <td>ItemSetValueByTypeAndId</td>
2594 <td>mdlDialog_itemSetStringValueByTypeAndId</td>
2595 </tr>
2596 <tr>
2597 <td>ItemSynchByTypeAndId</td>
2598 <td>mdlDialog_itemSynchByTypeAndId</td>
2599 </tr>
2600 <tr>
2601 <td>PopupClose</td>
2602 <td>mdlDialog_popupClose</td>
2603 </tr>
2604 <tr>
2605 <td>QueueCommandNumberByDb</td>
2606 <td>mdlDialog_cmdNumQByDbExt</td>
2607 </tr>
2608 <tr>
2609 <td>Refresh</td>
2610 <td>mdlDialog_refresh</td>
2611 </tr>
2612 <tr>
2613 <td>SendUserMessageToHook</td>
2614 <td>mdlDialog_hookDialogSendUserMsg</td>
2615 </tr>
2616 <tr>
2617 <td>SetCancelItem</td>
2618 <td>mdlDialog_itemSetCancel</td>
2619 </tr>
2620 <tr>
2621 <td>SetDefaultItem</td>
2622 <td>mdlDialog_itemSetDefault</td>
2623 </tr>
2624 <tr>
2625 <td>SetLayoutHelper</td>
2626 <td>mdlDialog_setLayoutHelper</td>
2627 </tr>
2628 <tr>
2629 <td>SetLastActionType</td>
2630 <td>mdlDialog_lastActionTypeSet</td>
2631 </tr>
2632 <tr>
2633 <td>SetUserData</td>
2634 <td>mdlDialog_userDataPtrSet</td>
2635 </tr>
2636 <tr>
2637 <td>Show</td>
2638 <td>mdlDialog_show</td>
2639 </tr>
2640 </table>
2641 *
2642 *<H3>MSWindow </H3>
2643 *<P>The MSWindow struct is defined in <Mstn\MdlApi\MSWindow.h> and is a subclass of BaseWindow. MSWindow is the new name for GuiWindow. The table below lists the MSWindow methods and the C-based mdlWindow functions they equate to. </P>
2644 *<table>
2645 <tr><th>MSWindow Method</th>
2646 <th>mdlWindow Function or Member</th>
2647 </tr>
2648 <tr>
2649 <td>Activate</td>
2650 <td>mdlWindow_setInputFocusExt</td>
2651 </tr>
2652 <tr>
2653 <td>ClearRect</td>
2654 <td>mdlWindow_rectClear</td>
2655 </tr>
2656 <tr>
2657 <td>Close</td>
2658 <td>mdlWindow_close</td>
2659 </tr>
2660 <tr>
2661 <td>GetAttributes</td>
2662 <td>mdlWindow_attributesGet</td>
2663 </tr>
2664 <tr>
2665 <td>GetContentRectGlobal</td>
2666 <td>mdlWindow_contentRectGetGlobal</td>
2667 </tr>
2668 <tr>
2669 <td>GetContentRectLocal</td>
2670 <td>mdlWindow_contentRectGetLocal</td>
2671 </tr>
2672 <tr>
2673 <td>GetGlobalRectGlobal</td>
2674 <td>mdlWindow_globalRectGetGlobal</td>
2675 </tr>
2676 <tr>
2677 <td>GetGlobalRectLocal</td>
2678 <td>mdlWindow_globalRectGetLocal</td>
2679 </tr>
2680 <tr>
2681 <td>GetViewport</td>
2682 <td>m_viewPort member</td>
2683 </tr>
2684 <tr>
2685 <td>GetDialogP</td>
2686 <td>(MSDialogP) this if mdlWindow_isDialogBox</td>
2687 </tr>
2688 <tr>
2689 <td>Hide</td>
2690 <td>mdlWindow_hide</td>
2691 </tr>
2692 <tr>
2693 <td>IsActive</td>
2694 <td>mdlWindow_isActiveAndVisible</td>
2695 </tr>
2696 <tr>
2697 <td>IsFocusable</td>
2698 <td>attributes.isFocusable Member</td>
2699 </tr>
2700 <tr>
2701 <td>IsObscured</td>
2702 <td>guiWindow_isObscured</td>
2703 </tr>
2704 <tr>
2705 <td>IsVisible</td>
2706 <td>mdlWindow_isVisible</td>
2707 </tr>
2708 <tr>
2709 <td>Show</td>
2710 <td>mdlWindow_show</td>
2711 </tr>
2712 </table>
2713 *
2714 *<H3>BaseWindow </H3>
2715 *<P>The BaseWindow struct is defined in <Mstn\MdlApi\BaseWindow.h> and is a subclass of WindowInfo. </P>
2716 *<table>
2717 <tr>
2718 <th>BaseWindow Method</th>
2719 <th>mdlWindow Function or Member</th></tr>
2720 <tr>
2721 <td>GetDockExtent</td>
2722 <td>dockExtent member</td>
2723 </tr>
2724 <tr>
2725 <td>GetDockPosition</td>
2726 <td>mdlWindow_getDocked</td>
2727 </tr>
2728 <tr>
2729 <td>GetDockPriority</td>
2730 <td>mdlWindow_getDockPriority</td>
2731 </tr>
2732 <tr>
2733 <td>GetTitle</td>
2734 <td>mdlWindow_titleGet</td>
2735 </tr>
2736 <tr>
2737 <td>GetTitleCP</td>
2738 <td>name member</td>
2739 </tr>
2740 <tr>
2741 <td>IsDisplayed</td>
2742 <td>mdlWindow_isDisplayed</td>
2743 </tr>
2744 <tr>
2745 <td>Maximized</td>
2746 <td>mdlWindow_isMaximized</td>
2747 </tr>
2748 <tr>
2749 <td>Minimized</td>
2750 <td>mdlWindow_isMinimized</td>
2751 </tr>
2752 <tr>
2753 <td>SetTitle</td>
2754 <td>mdlWindow_titleSet</td>
2755 </tr>
2756 </table>
2757 *
2758 *<H3>WindowInfo </H3>
2759 *<P>The WindowInfo struct is also defined in <Mstn\MdlApi\BaseWindow.h>. </P>
2760 * <table>
2761 <tr>
2762 <th>WindowInfo Method</th>
2763 <th>mdlWindow Function or Member</th>
2764 </tr>
2765 <tr>
2766 <td>GetNext</td>
2767 <td>mdlWindow_getNext</td>
2768 </tr>
2769 <tr>
2770 <td>GetPrevious</td>
2771 <td>mdlWindow_getPrevious</td>
2772 </tr>
2773 <tr>
2774 <td>GetGraphHandle</td>
2775 <td>graphHandle member</td>
2776 </tr>
2777 <tr>
2778 <td>GetScreenNumber</td>
2779 <td>mdlWindow_screenNumGet</td>
2780 </tr>
2781 </table>
2782 *
2783 *<H3>DialogItem </H3>
2784 *<P>The DialogItem struct is defined in <Mstn\MdlApi\DialogItem.h>. The table below lists the DialogItem methods and the C-based mdlDialog functions they equate to. </P>
2785 *<table>
2786 <tr>
2787 <th>DialogItem Method</th>
2788 <th>mdlDialog Function or Member</th>
2789 </tr>
2790 <tr>
2791 <td>Draw</td>
2792 <td>mdlDialog_rItemDrawEx</td>
2793 </tr>
2794 <tr>
2795 <td>GetAttributes</td>
2796 <td>attributes member</td>
2797 </tr>
2798 <tr>
2799 <td>GetColor</td>
2800 <td>mdlDialog_rItemGetColor</td>
2801 </tr>
2802 <tr>
2803 <td>GetDialog</td>
2804 <td>rawItemP-&gt;ownerDialogP member</td>
2805 </tr>
2806 <tr>
2807 <td>GetId</td>
2808 <td>id member</td>
2809 </tr>
2810 <tr>
2811 <td>GetLabel</td>
2812 <td>mdlDialog_rItemLabelGet</td>
2813 </tr>
2814 <tr>
2815 <td>GetLabelLength (# characters)</td>
2816 <td>mdlDialog_rItemLabelLengthGet</td>
2817 </tr>
2818 <tr>
2819 <td>GetLabelWidth (# pixels)</td>
2820 <td>GetLabelWidth</td>
2821 </tr>
2822 <tr>
2823 <td>GetNextVisible</td>
2824 <td>mdlDialog_itemGetNextVisible</td>
2825 </tr>
2826 <tr>
2827 <td>GetOwnerItem</td>
2828 <td>mdlDialog_rItemOwnerItemGet</td>
2829 </tr>
2830 <tr>
2831 <td>GetPopupMenuText</td>
2832 <td>mdlDialog_rItemPopupMenuLabelGet</td>
2833 </tr>
2834 <tr>
2835 <td>GetRawItem</td>
2836 <td>rawIPtemP member</td>
2837 </tr>
2838 <tr>
2839 <td>GetRect</td>
2840 <td>rect member</td>
2841 </tr>
2842 <tr>
2843 <td>GetType</td>
2844 <td>type member</td>
2845 </tr>
2846 <tr>
2847 <td>GetState</td>
2848 <td>mdlDialog_rItemStateGet</td>
2849 </tr>
2850 <tr>
2851 <td>GetTypePtr</td>
2852 <td>static_cast&lt;T&gt; if (itemType == this-&gt;type)</td>
2853 </tr>
2854 <tr>
2855 <td>GetValue (MSValueDescrR)</td>
2856 <td>mdlDialog_rItemValueGet</td>
2857 </tr>
2858 <tr>
2859 <td>GetValue (WStringR)</td>
2860 <td>mdlDialog_rItemStringValueGet</td>
2861 </tr>
2862 <tr>
2863 <td>HasFocus</td>
2864 <td>attributes.hasFocus member</td>
2865 </tr>
2866 <tr>
2867 <td>Hide</td>
2868 <td>mdlDialog_rItemHide</td>
2869 </tr>
2870 <tr>
2871 <td>IsEnabled</td>
2872 <td>attributes.enabled member</td>
2873 </tr>
2874 <tr>
2875 <td>IsFocusable</td>
2876 <td>mdlDialog_rItemIsFocusable</td>
2877 </tr>
2878 <tr>
2879 <td>IsDisplayable</td>
2880 <td>mdlDialog_rItemIsDisplayable</td>
2881 </tr>
2882 <tr>
2883 <td>Move</td>
2884 <td>mdlDialog_rItemMove</td>
2885 </tr>
2886 <tr>
2887 <td>Obscure</td>
2888 <td>mdlDialog_rItemObscure (true)</td>
2889 </tr>
2890 <tr>
2891 <td>PopupClose</td>
2892 <td>mdlDialog_rItemPopupClose</td>
2893 </tr>
2894 <tr>
2895 <td>PopupOpen</td>
2896 <td>mdlDialog_rItemPopupOpen</td>
2897 </tr>
2898 <tr>
2899 <td>ReloadData</td>
2900 <td>mdlDialog_rItemReloadData</td>
2901 </tr>
2902 <tr>
2903 <td>SetBalloonText</td>
2904 <td>mdlDialog_rItemBalloonTextSet</td>
2905 </tr>
2906 <tr>
2907 <td>SetColor</td>
2908 <td>mdlDialog_rItemSetColor</td>
2909 </tr>
2910 <tr>
2911 <td>SetDisabledBalloonText</td>
2912 <td>mdlDialog_rItemDisabledBalloonTextSet</td>
2913 </tr>
2914 <tr>
2915 <td>SetEnabled</td>
2916 <td>mdlDialog_rItemEnabledStateSet</td>
2917 </tr>
2918 <tr>
2919 <td>SetExtent</td>
2920 <td>mdlDialog_rItemExtentSet</td>
2921 </tr>
2922 <tr>
2923 <td>SetFlyoverText</td>
2924 <td>mdlDialog_rItemFlyoverTextSet</td>
2925 </tr>
2926 <tr>
2927 <td>SetLabel</td>
2928 <td>mdlDialog_rItemLabelSet</td>
2929 </tr>
2930 <tr>
2931 <td>SetLabelFont</td>
2932 <td>mdlDialog_rItemLabelFontSet</td>
2933 </tr>
2934 <tr>
2935 <td>SetPopupMenuText</td>
2936 <td>mdlDialog_rItemPopupMenuTextSet</td>
2937 </tr>
2938 <tr>
2939 <td>SetState</td>
2940 <td>mdlDialog_rItemStateSet</td>
2941 </tr>
2942 <tr>
2943 <td>SetValue (MSValueDescrCR)</td>
2944 <td>mdlDialog_rItemValueSet</td>
2945 </tr>
2946 <tr>
2947 <td>SetValue (WCharCP)</td>
2948 <td>mdlDialog_rItemStringValueSet</td>
2949 </tr>
2950 <tr>
2951 <td>Show</td>
2952 <td>mdlDialog_rItemShow</td>
2953 </tr>
2954 <tr>
2955 <td>Synchronize</td>
2956 <td>mdlDialog_rItemSynch</td>
2957 </tr>
2958 <tr>
2959 <td>SynchornizeOthers</td>
2960 <td>mdlDialog_rItemSynchOthers</td>
2961 </tr>
2962 <tr>
2963 <td>Unobscure</td>
2964 <td>mdlDialog_rItemObscure (false)</td>
2965 </tr>
2966 </table>
2967 *
2968 *<H3>Dialog Items </H3>
2969 *<P>Some of the MDL Dialog Items have been exposed as new structs with methods. The <Mstn\MdlApi\DialogItems.h> header includes a header per Dialog Item that has an associated struct. As mentioned before, we are evaluating the cost-benefit ratio to determine whether we should add more. So other items will be added on an as-needed basis. </P>
2970 *<UL>
2971 * <LI>Container.h</LI>
2972 * <LI>ContainerPanel.h </LI>
2973 * <LI>ListBox.h </LI>
2974 * <LI>OptionButton.h </LI>
2975 * <LI>PushButton.h </LI>
2976 * <LI>TextBox.h</LI>*
2977 *</UL>
2978 *
2979 *<H2>C++ Hook Handlers </H2>
2980 *<P>The ability to develop Dialog Hooks and Dialog Item Hooks in C++ has been added. The C++ version of a hook is known as a "Hook Handler". There is a base class for the hook handlers: DialogHookHandler and DialogItemHookHandler. These are defined in <Mstn\MdlApi\dlogitem.h>. There are virtual methods for each of the hook message types, and there is a structure for most of the message types. The same structures from the DialogMessage and DialogItemMessage "u" unions are used as arguments to the hook handler methods. This introduces a level of type safety that did not exist with the "u" unions. The only limitation to this new architecture is that switch case "fall-through" is no longer possible. However, this limitation can easily be compensated for with a private method that one or more hook handler methods call. </P>
2981 *
2982 *<H3>Example of Message Type Structs from dlogitem.h </H3>
2983 *<P>The Message Type struct examples below are in <Mstn\MdlApi\dlogitem.h>. The structs that were defined directly in the DialogMessage and DialogItemMessage "u" unions in V8i were split out into separate structs in CONNECT Edition, as you see below. Those structs are then referenced in DialogMessage, DialogItemMessage and the various hook handler methods. </P>
2984 *
2985 * @code{.unparsed}
2986 */*-----------------------------------------------------------------------
2987  DIALOG_MESSAGE_CREATE
2988  Sent before item hooks are sent create messages
2989  +-----------------------------------------------------------------------*/
2990  struct DialogCreateArgs
2991  {
2992  bool createFailed; /* <= set true if error */
2993  DialogHookInterests interests; /* <= */
2994  void** userDataPP; /* <= */
2995  DialogBoxRsc* dialogBoxRP; /* => */
2996  };
2997 
2998  typedef struct DialogCreateArgs& DialogCreateArgsR;
2999 
3000  /*-----------------------------------------------------------------------
3001  DIALOG_MESSAGE_INIT
3002  sent after all item hooks are sent create messages
3003  +-----------------------------------------------------------------------*/
3004  struct DialogInitArgs
3005  {
3006  bool initFailed; /* <= set true if error */
3007  };
3008 
3009  typedef struct DialogInitArgs& DialogInitArgsR;
3010 *
3011 *
3012 * @endcode
3013 *
3014 *<H3>DialogMessage struct excerpt from dlogitem.h </H3>
3015 *
3016 * @code{.unparsed}
3017 * struct DialogMessage
3018  {
3019  bool msgUnderstood; /* <= message understood? */
3020  DialogMessageType messageType; /* => message type */
3021  MSDialogP db; /* => dialog box handle */
3022  long dialogId; /* => resource id of dialog box */
3023  void* userDataP; /* => set by user during CREATE */
3024  union
3025  {
3026  DialogHookResolveArgs hookResolve; /* DIALOG_MESSAGE_HOOKRESOLVE */
3027 
3028  DialogCreateArgs create; /* DIALOG_MESSAGE_CREATE */
3029  DialogInitArgs init; /* DIALOG_MESSAGE_INIT */
3030 
3031  . . .
3032 
3033  } u;
3034  };
3035 
3036 * @endcode
3037 *
3038 *<H3>DialogHookHandler struct excerpt from dlogitem.h </H3>
3039 *
3040 * @code{.unparsed}
3041 *struct DialogHookHandler
3042  {
3043  MSDialogP m_dbP;
3044  void* m_userDataP;
3045 
3046  DialogHookHandler (MSDialogP dbP) : m_dbP (dbP) {}
3047  virtual ~DialogHookHandler() {}
3048 
3049  MSDialogP GetDbP() { return m_dbP; }
3050 
3051  void SetUserDataP (void *v) { m_userDataP = v; }
3052  void* GetUserDataP () { return m_userDataP; }
3053 
3054  virtual bool OnCreate (DialogCreateArgsR create) { return false; }
3055  virtual bool OnInit (DialogInitArgsR init) { return false; }
3056 
3057  . . .
3058 
3059  };
3060 *
3061 * @endcode
3062 *
3063 *<H3>Example Dialog Hook Handler in Application Code </H3>
3064 *<P>Each dialog hook handler is a subclass of DialogHookHandler. Hook IDs are still supported and can be referenced in a resource file. A static method within the hook handler serves as the function published as the dialog hook. As a convention, this method should be named "HookResolve". When a dialog is being created and the dialog hook ID to function association is being resolved, the Dialog Manager sends a DIALOG_MESSAGE_HOOKRESOLVE message to the dialog hook. The "HookResolve" method is responsible for instantiating the dialog hook handler instance, setting the dmP->u.hookResolve.hookHandlerP member to that handler object, and setting dmP->msgUnderstood to true. Thereafter, virtual method overrides on the dialog hook handler object will be called for each message. </P>
3065 *
3066 * @code{.unparsed}
3067 * // Dialog Hook Handler
3068  struct MyDialogHookHandler : DialogHookHandler
3069  {
3070  static void HookResolve (DialogMessage *dmP)
3071  {
3072  if (DIALOG_MESSAGE_HOOKRESOLVE == dmP->messageType)
3073  {
3074  dmP->u.hookResolve.hookHandlerP = new MyDialogHookHandler (dmP->db);
3075  dmP->msgUnderstood = true;
3076  }
3077  }
3078 
3079  // Item Hook Handler Constructor
3080  MyDialogHookHandler (MSDialogP dbP) : DialogHookHandler (dbP) {}
3081 
3082  // Dialog Hook Handler Method override
3083  virtual bool OnCreate (DialogCreateArgsR create) override
3084  {
3085  // OnCreate processing
3086  return true;
3087  }
3088 
3089  // Other hook handler method overrides . . .
3090  };
3091 *
3092 * @endcode
3093 *
3094 *<H3>Example Dialog Item Hook Handler application code </H3>
3095 *<P>Similar to the DialogHookHandler, each dialog item hook handler is a subclass of DialogItemHookHandler. The item hook IDs are still supported and can be referenced in a resource file. A static method within the item hook handler serves as the function published as the item hook. As a convention, this method should be named "HookResolve". When a dialog item is being created and the item hook ID to function association is being resolved, the Dialog Manager sends a DITEM_MESSAGE_HOOKRESOLVE message to the item hook. The "HookResolve" method is responsible for instantiating the item hook handler instance, setting the dimP->u.hookResolve.hookHandlerP member to that handler object, and setting dimP->msgUnderstood to true. Thereafter, virtual method overrides on the item hook handler object will be called for each message. </P>
3096 *
3097 * @code{.unparsed}
3098 *// Dialog Item Hook Handler
3099  struct MyItemHookHandler : DialogItemHookHandler
3100  {
3101  // Dialog Hook replacement function
3102  static void HookResolve (DialogItemMessage *dimP)
3103  {
3104  if (DITEM_MESSAGE_HOOKRESOLVE == dimP->messageType)
3105  {
3106  dimP->u.hookResolve.hookHandlerP = new MyItemHookHandler (dimP->db, dimP->dialogItemP);
3107  dimP->msgUnderstood = true;
3108  }
3109  }
3110 
3111  // Item Hook Handler Constructor
3112  MyItemHookHandler (MSDialogP dbP, DialogItemP diP) : DialogItemHookHandler (dbP, diP) {}
3113 
3114  // Item Hook Handler Method override
3115  virtual bool OnCreate (DialogItemCreateArgsR create) override
3116  {
3117  // OnCreate processing
3118  return true;
3119  }
3120 
3121  // Other hook handler method overrides . . .
3122  };
3123 *
3124 * @endcode
3125 *
3126 *<H3>Example DialogHookInfo hook array in application code </H3>
3127 *<P>Dialog hook IDs and item hook IDs are still supported and can be referenced in a resource file. A hook function per ID is still required and is still published by calling mdlDialog_hookPublish. But when using dialog and/or item hook handlers, that function is usually simply a static method in the hook handler, and by convention is named "HookResolve". The example below shows the ID to HookResolve static method association. </P>
3128 *
3129 *@code{.unparsed}
3130 *static DialogHookInfo uHooks[] =
3131  {
3132  {HOOKDIALOGID_MyDialog, (PFDialogHook) MyDialogHookHandler::HookResolve},
3133  {HOOKITEMID_MyItem, (PFDialogHook) MyItemHookHandler::HookResolve},
3134  . . .
3135  };
3136 
3137  . . .
3138 
3139  /* Publish the dialog item hooks */
3140  mdlDialog_hookPublish (_countof(uHooks), uHooks);
3141 *
3142 * @endcode
3143 *
3144 *<H2>MDL Layout Manager</H2>
3145 *<P>In an MDL Dialog Box item list specification, you can only specify a static X and Y position and a width and height for a dialog item. In code, you can alter those positions and sizes, especially when the dialog is being resized. But implementing a resizable dialog can be tedious. In addition, adjusting aspect ratios by localization teams is rather expensive. As stated before, we will not be converting all MDL dialogs to WPF in the CONNECT Edition release. </P>
3146 *
3147 *<P>A dialog layout system provides a simple and powerful way of automatically arranging child controls within a dialog to ensure that they make good use of the available space. For the CONNECT Edition release, we have added a layout system to the MDL Dialog Manager. We implemented an independent layout engine library and integrated it into the MDL Dialog Manager via a C++ API. We have also added the ability to specify layout parameters in a dialog resource. The inspiration for our Layout Manager came from the layout systems in Qt, WPF and Java. Those layout systems are used to describe how controls are laid out in an application's user interface. They automatically position and resize controls when the amount of space available for them changes, ensuring that they are consistently arranged and that the user interface as a whole remains usable. Different label widths are automatically accommodated. Since the layout engine is independent, we can also use it in MFC dialogs. </P>
3148 *
3149 *<H3>Layout Types </H3>
3150 *<P>There are 5 different layout types in the Layout Manager. </P>
3151 *<UL>
3152 * <LI>GridLayout - lays out controls in rows and columns </LI>
3153 * <LI>StackLayout - lines up controls horizontally or vertically </LI>
3154 * <LI>DockLayout - put controls along the top, bottom, left or right </LI>
3155 * <LI>FlowLayout - lines up controls horizontally as space permits then puts them on a separate line below when there's not enough space </LI>
3156 * <LI>SplitterLayout - put controls on either size of a Sash, or Splitter, control </LI>
3157 *</UL>
3158 *
3159 *<H3>Dialog Manager Integration </H3>
3160 *<P>The independent layout engine library source is located in the UIFramework repository. The layout engine is integrated into the MDL Dialog Manager via a set of C++ classes that are defined in <Mstn\MdlApi\GuiLayout.h>. </P>
3161 *<UL>
3162 * <LI>GuiLayoutHelper - contains the overall layout for a dialog </LI>
3163 * <LI>GuiLayoutControl - layout wrapper for a dialog item in the dialog </LI>
3164 * <LI>GuiLayoutLabel - layout wrapper for a label in the dialog </LI>
3165 * <LI>GuiLayoutContainerPanel - layout wrapper for a ContainerPanel in the dialog </LI>
3166 * <LI>GuiSplitterHandle - used to easily layout a control on either side of a Sash control </LI>
3167 * <LI>GuiLayoutProperties - contains layout-oriented properties for dialog items and layouts </LI>
3168 *</UL>
3169 *
3170 *<P>The GuiLayoutHelper maintains the top-level layout for the dialog. GuiLayoutControls are used as wrappers for each of the dialog items on the dialog. When an item is added to a layout using the GuiLayoutControl class, the caller specifies size policies and optional margins and spacing. A size can be specified as fixed or a minimum, maximum and preferred size can be specified via method overrides. The RawItemHdr for each dialog item has a 'layoutPropertiesP' member which points to a GuiLayoutProperties struct. Layout properties such as Size Policy, Margins and Minimum Size are located in this struct. Numerous layouts can be nested to achieve the overall layout for the dialog. </P>
3171 *
3172 *<H3>More Information </H3>
3173 *<P>More information on the MDL Dialog Layout Manager can be found on the following pages: </P>
3174 *<UL>
3175 * <LI>@DialogBoxLayoutManager "Layout Manager For Dialog Box" </LI>
3176 * <LI>@LayoutManagerMigration "Layout Manager Migration Guide" </LI>
3177 *</UL>
3178 *
3179 *<H2>WPF </H2>
3180 *<P>Windows Presentation Foundation, or WPF, is the newest Windows desktop UI framework offered by Microsoft. It was introduced in .NET 3.0 in late 2006. At the request of the Visual Studio 2010 team, some major performance and visual improvements were introduced in .NET 4.0 in 2010. The development languages used are XAML (eXtensible Application Markup Language), which is an XML-based declarative language used to specify the UI elements and layout, and either C# or VB.NET. WPF renders using DirectX instead of GDI/GDI+, and it aims to unify a number of common user interface elements, such as 2D/3D rendering, fixed and adaptive documents, typography, vector graphics, animation and media. </P>
3181 *<P>Two of WPF's main strengths are: </P>
3182 *<OL>
3183 * <LI>the separation between the look of the UI, based on styles and templates, and the processing for the UI, based on commands and events </LI>
3184 * <LI> data binding, which establishes a relationship that tells WPF to extract some information from a source object and use it to set a property in a target object.The target object is always a WPF dependency property, and it's usually in a WPF element derived from DependencyProperty .The source can be properties of another WPF Element or Control, properties in any CLR object, XML fragments or ADO.NET data object.Many features within WPF rely heavily on the data binding system. </LI>
3185 *</OL>
3186 *
3187 *
3188 *
3189 *
3190 *
3191 *
3192 *
3193 *
3194 *
3195 *
3196 *
3197 *
3198 *
3199 *
3200 *
3201 *
3202 *
3203 *
3204 *
3205 *
3206 *
3207 *
3208 *
3209 *
3210 *
3211 *
3212 *
3213 *
3214 *
3215 *
3216 *
3217 *
3218 *
3219 *
3220 *
3221 *
3222 *
3223 *
3224 *
3225 *
3226 *
3227 *
3228 *
3229 *
3230 *
3231 *
3232 *
3233 *
3234 *
3235 *
3236 *
3237 *
3238 *
3239 *
3240 *
3241 *
3242 *
3243 *
3244 *
3245 *
3246 *
3247 *
3248 *
3249 *
3250 *
3251 *
3252 *
3253 *
3254 *
3255 *
3256 *
3257 *
3258 *
3259 *
3260 *
3261 *
3262 *
3263 *
3264 *
3265 
3266 
3267 
3268 
3269 
3270 
3271 
3272 
3273 
3274 
3275 
3276 
3277 
3278 
3279 
3280 
3281 *****************************************************************************************/
char * CharP
Definition: Bentley.h:227
Dialog Item Message Structures.
Definition: dlogitem.h:2014
DITEM_MESSAGE_GETSTATE & DITEM_MESSAGE_SETSTATE message arguments.
Definition: dlogitem.h:1872
DialogItemValueArgs value
Definition: dlogitem.h:2072
wchar_t WChar
Definition: Bentley.h:223
Definition: vartypes.h:75
WCharCP formatStrP
Definition: dlogitem.h:1881
The StackLayout class lines up child controls horizontally or vertically.
Definition: StackLayout.h:83
wchar_t const * WCharCP
Definition: Bentley.h:224
int BoolInt
Definition: VisEdgesLib.h:149
MSValueDescrP msValueDescrP
Definition: dlogitem.h:1876
CharP accessStrP
Definition: dlogitem.h:1878
The viewport is resized to match the aspect ratio of the viewInfo.
bool cancelled
Definition: dlogitem.h:1885
unsigned char byte
Definition: Bentley.r.h:144
Definition: vartypes.h:53
bool valueChanged
Definition: dlogitem.h:1884
DockLayout arranges items according to a specified dock position.
Definition: DockLayout.h:45
The GridLayout class lays out controls in a table or grid.
Definition: GridLayout.h:70
unsigned char Byte
Definition: Bentley.r.h:143
bool hookHandled
Definition: dlogitem.h:1874
size_type size() const
Definition: stdcxx/bstdmap.h:214
The Flow Layout Manager arranges items from left to right and top to bottom.
Definition: FlowLayout.h:26
union DialogItemMessage::@185 u

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.