File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ BOOL WINAPI GetSaveFileNameW(CE_OPENFILENAME*);
8787** Version
8888**============================================================================*/
8989
90- #define SQLITECEDIT_VERSION L"0.10.0.21 "
90+ #define SQLITECEDIT_VERSION L"0.10.0.22 "
9191
9292/*============================================================================
9393** Menu IDs
Original file line number Diff line number Diff line change @@ -470,6 +470,22 @@ void PopulateGrid(void) {
470470 headerWidth = ListView_GetColumnWidth (g_hwndGrid , j );
471471 if (contentWidth > headerWidth )
472472 ListView_SetColumnWidth (g_hwndGrid , j , contentWidth );
473+ /* In edit mode, ensure column fits placeholder hints */
474+ if (g_editMode && j < g_colMetaCount ) {
475+ HDC hdc = GetDC (g_hwndGrid );
476+ if (hdc ) {
477+ SIZE sz ;
478+ int hintWidth , curWidth ;
479+ const wchar_t * hint = g_colMeta [j ].isAutoInc ? L"(auto)" :
480+ (!g_colMeta [j ].notNull ? L"(null)" : L"" );
481+ GetTextExtentPoint32W (hdc , hint , lstrlenW (hint ), & sz );
482+ hintWidth = sz .cx + 12 ; /* padding */
483+ curWidth = ListView_GetColumnWidth (g_hwndGrid , j );
484+ if (hintWidth > curWidth )
485+ ListView_SetColumnWidth (g_hwndGrid , j , hintWidth );
486+ ReleaseDC (g_hwndGrid , hdc );
487+ }
488+ }
473489 }
474490 ListView_SetItemCount (g_hwndGrid , totalRows );
475491 }
You can’t perform that action at this time.
0 commit comments