MCPcopy Create free account
hub / github.com/assimp/assimp / InitUI

Function InitUI

tools/assimp_view/MessageProc.cpp:1018–1202  ·  view source on GitHub ↗

------------------------------------------------------------------------------- Initialize the user interface -------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1016// Initialize the user interface
1017//-------------------------------------------------------------------------------
1018void InitUI() {
1019 SetDlgItemText(g_hDlg,IDC_EVERT,"0");
1020 SetDlgItemText(g_hDlg,IDC_EFACE,"0");
1021 SetDlgItemText(g_hDlg,IDC_EMAT,"0");
1022 SetDlgItemText(g_hDlg,IDC_ESHADER,"0");
1023 SetDlgItemText(g_hDlg,IDC_ENODEWND,"0");
1024 SetDlgItemText(g_hDlg,IDC_ETEX,"0");
1025 SetDlgItemText(g_hDlg,IDC_EMESH,"0");
1026
1027#ifndef ASSIMP_BUILD_NO_EXPORT
1028 PopulateExportMenu();
1029#endif
1030
1031 // setup the default window title
1032 SetWindowText(g_hDlg,AI_VIEW_CAPTION_BASE);
1033
1034 // read some UI properties from the registry and apply them
1035 DWORD dwValue;
1036 DWORD dwTemp = sizeof( DWORD );
1037
1038 // store the key in a global variable for later use
1039 RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\ASSIMP\\Viewer",
1040 0,nullptr,0,KEY_ALL_ACCESS, nullptr, &g_hRegistry,nullptr);
1041
1042 if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"LastUIState",nullptr,nullptr, (BYTE*)&dwValue,&dwTemp)) {
1043 dwValue = 1;
1044 }
1045 if (0 == dwValue) {
1046 // collapse the viewer
1047 // adjust the size
1048 RECT sRect;
1049 GetWindowRect(g_hDlg,&sRect);
1050 sRect.right -= sRect.left;
1051 sRect.bottom -= sRect.top;
1052
1053 RECT sRect2;
1054 GetWindowRect(GetDlgItem ( g_hDlg, IDC_BLUBB ),&sRect2);
1055 sRect2.left -= sRect.left;
1056 sRect2.top -= sRect.top;
1057
1058 SetWindowPos(g_hDlg,nullptr,0,0,sRect.right-214,sRect.bottom,
1059 SWP_NOMOVE | SWP_NOZORDER);
1060 SetWindowText(GetDlgItem(g_hDlg,IDC_BLUBB),">>");
1061 } else {
1062 CheckDlgButton(g_hDlg,IDC_BLUBB,BST_CHECKED);
1063 }
1064
1065 // AutoRotate
1066 if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"AutoRotate",nullptr,nullptr,
1067 (BYTE*)&dwValue,&dwTemp))dwValue = 0;
1068 if (0 == dwValue) {
1069 g_sOptions.bRotate = false;
1070 CheckDlgButton(g_hDlg,IDC_AUTOROTATE,BST_UNCHECKED);
1071 } else {
1072 g_sOptions.bRotate = true;
1073 CheckDlgButton(g_hDlg,IDC_AUTOROTATE,BST_CHECKED);
1074 }
1075

Callers 1

MessageProcFunction · 0.85

Calls 3

PopulateExportMenuFunction · 0.85
SetupPPUIStateFunction · 0.85
LoadCheckerPatternColorsFunction · 0.85

Tested by

no test coverage detected