MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / Style_AddLexerToTreeView

Function Style_AddLexerToTreeView

src/Styles.c:2960–2992  ·  view source on GitHub ↗

============================================================================= Style_AddLexerToTreeView()

Source from the content-addressed store, hash-verified

2958// Style_AddLexerToTreeView()
2959//
2960void Style_AddLexerToTreeView ( HWND hwnd, PEDITLEXER plex )
2961{
2962 int i = 0;
2963 WCHAR tch[128];
2964 HTREEITEM hTreeNode;
2965 TVINSERTSTRUCT tvis;
2966 ZeroMemory ( &tvis, sizeof ( TVINSERTSTRUCT ) );
2967 tvis.hInsertAfter = TVI_LAST;
2968 tvis.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
2969 if ( GetString ( plex->rid, tch, COUNTOF ( tch ) ) ) {
2970 tvis.item.pszText = tch;
2971 } else {
2972 tvis.item.pszText = plex->pszName;
2973 }
2974 tvis.item.iImage = Style_GetLexerIconId ( plex );
2975 tvis.item.iSelectedImage = tvis.item.iImage;
2976 tvis.item.lParam = ( LPARAM ) plex;
2977 hTreeNode = ( HTREEITEM ) TreeView_InsertItem ( hwnd, &tvis );
2978 tvis.hParent = hTreeNode;
2979 tvis.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
2980 //tvis.item.iImage = -1;
2981 //tvis.item.iSelectedImage = -1;
2982 while ( plex->Styles[i].iStyle != -1 ) {
2983 if ( GetString ( plex->Styles[i].rid, tch, COUNTOF ( tch ) ) ) {
2984 tvis.item.pszText = tch;
2985 } else {
2986 tvis.item.pszText = plex->Styles[i].pszName;
2987 }
2988 tvis.item.lParam = ( LPARAM ) ( &plex->Styles[i] );
2989 TreeView_InsertItem ( hwnd, &tvis );
2990 i++;
2991 }
2992}
2993
2994
2995//=============================================================================

Callers 1

Style_ConfigDlgProcFunction · 0.85

Calls 1

Style_GetLexerIconIdFunction · 0.85

Tested by

no test coverage detected