void __fastcall TfmFeaturesMain::tvNavBarChange(TObject *Sender, TTreeNode *Node) { UpdateGroupProperties(); UpdateItemProperties(); if (Node->Level == 0){ HidePropertiesTabSheet(tsSelectedItemProps); ShowPropertiesTabSheet(tsSelectedGroupProps); } else{ HidePropertiesTabSheet(tsSelectedGroupProps); ShowPropertiesTabSheet(tsSelectedItemProps); } }
void __fastcall TfmFeaturesMain::btDeleteLinkClick(TObject *Sender) { if (CurrentLink != NULL) { TdxNavBarItemLink *ALink = CurrentLink; if (((TObject*)tvNavBar->Selected->Data)->ClassType() == __classid(TdxNavBarItemLink)) tvNavBar->Items->Delete(tvNavBar->Selected); ALink->Group->RemoveLink(ALink->Index); SelectDefaultGroup(); UpdateGroupProperties(); UpdateItemProperties(); } }
void __fastcall TfmFeaturesMain::btDeleteGroupClick(TObject *Sender) { if (CurrentGroup != NULL) { TdxNavBarGroup *AGroup = CurrentGroup; if (((TObject*)tvNavBar->Selected->Data)->ClassType() == __classid(TdxNavBarGroup)) tvNavBar->Items->Delete(tvNavBar->Selected); else tvNavBar->Items->Delete(tvNavBar->Selected->Parent); nbMain->Groups->Delete(AGroup->Index); SelectDefaultGroup(); UpdateGroupProperties(); UpdateItemProperties(); } }
void __fastcall TfmFeaturesMain::FormCreate(TObject *Sender) { ClearPopupMenuItems(miLookAndFeel); for (int I = 0; I < dxNavBarViewsFactory()->Count; I++) AddDropDownMenuItem(miLookAndFeel, dxNavBarViewsFactory()->Names[I], -1, true, miLookAndFeelItemClick); miLookAndFeel->Items[dxNavBarViewsFactory()->IndexOfID(nbMain->View)]->Checked = true; gbProperties->Height = 190; actShowCaptions->Checked = nbMain->ShowGroupCaptions; actAllowSelectLinks->Checked = nbMain->AllowSelectLinks; actEachGroupHasSelectedLink->Checked = nbMain->EachGroupHasSelectedLink; actShowGroupHints->Checked = nbMain->ShowGroupsHint; actShowLinkHints->Checked = nbMain->ShowLinksHint; InitImageIndexComoboBoxes(); UpdateTreeView(); SelectDefaultGroup(); UpdateGroupProperties(); UpdateItemProperties(); }
void __fastcall TfmFeaturesMain::btAddGroupClick(TObject *Sender) { TdxNavBarGroup *AGroup = nbMain->Groups->Add(); TTreeNode *ANode, *AParentNode; AGroup->OnClick = NavBarItemClick; if (CurrentGroup != NULL) { if (((TObject*)tvNavBar->Selected->Data)->ClassType() == __classid(TdxNavBarGroup)) AParentNode = tvNavBar->Selected; else AParentNode = tvNavBar->Selected->Parent; ANode = tvNavBar->Items->InsertObject(AParentNode, AGroup->Caption, AGroup); AGroup->Index = CurrentGroup->Index; } else ANode = tvNavBar->Items->AddObject(NULL, AGroup->Caption, AGroup); ANode->ImageIndex = AGroup->SmallImageIndex; ANode->SelectedIndex = ANode->ImageIndex; tvNavBar->Selected = ANode; tvNavBar->FullExpand(); UpdateGroupProperties(); UpdateItemProperties(); }
INT_PTR CALLBACK GroupsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { PGROUP_DATA pGroupData; UNREFERENCED_PARAMETER(lParam); UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(hwndDlg); pGroupData = (PGROUP_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER); switch (uMsg) { case WM_INITDIALOG: pGroupData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GROUP_DATA)); SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGroupData); pGroupData->hPopupMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDM_POPUP_GROUP)); OnInitDialog(hwndDlg); SetMenuDefaultItem(GetSubMenu(pGroupData->hPopupMenu, 1), IDM_GROUP_PROPERTIES, FALSE); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDM_GROUP_NEW: case IDC_GROUPS_ADD: GroupNew(hwndDlg); break; case IDM_GROUP_RENAME: GroupRename(hwndDlg); break; case IDM_GROUP_DELETE: case IDC_GROUPS_REMOVE: GroupDelete(hwndDlg); break; case IDM_GROUP_PROPERTIES: case IDC_GROUPS_PROPERTIES: if (GroupProperties(hwndDlg) == IDOK) UpdateGroupProperties(hwndDlg); break; } break; case WM_NOTIFY: return OnNotify(hwndDlg, pGroupData, (NMHDR *)lParam); case WM_DESTROY: DestroyMenu(pGroupData->hPopupMenu); HeapFree(GetProcessHeap(), 0, pGroupData); break; } return FALSE; }
void __fastcall TfmFeaturesMain::FormActivate(TObject *Sender) { UpdateGroupProperties(); UpdateItemProperties(); }