Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Inline editing: How explorer does it?

Inline editing: How explorer does it?

Scheduled Pinned Locked Moved C / C++ / MFC
question
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dimitris Vikeloudas
    wrote on last edited by
    #1

    I am developing diagram editor where I am trying to add an inline edit focility. The editor is a CScrollView subclass and on text areas I impose a CEdit view subclass to permit inline change of the text. I observed the following on Windows Explorer. Assume you start renaming a file. Type an invalid file name (e.g. a dublicated one)and then try to select another window. The explorer does not leave you to do that. It will prompt that the filename is invalid and then it will keep the window on top. Thus, you cannot go away with an invalid name. How does it manages to stay on top if the name is not valid? It is necessary for me to achieve that if I want to have a consistent behaviour with the explorer (i.e. to comit changes if the input focus is lost). I know that must be done upon the receival of the EN_KILLFOCUS message. I 've tried that code BOOL U_W_SCROLL_VIEW::OnCommand( WPARAM wParam, LPARAM lParam ) { if( m_pEdit->GetSafeHwnd() == (HWND) lParam ) switch(HIWORD(wParam)) { ............... case EN_KILLFOCUS: if( this->IsIconic() ) cancel_edit(); else { confirm_edit(); // This will delete the CEdit subclass if the code is invalid if( m_pEdit != (U_W_Edit *) NULL ) { this->BringWindowToTop(); this->SetActiveWindow(); m_pEdit->SetFocus(); } return TRUE; ..................... } return FALSE; }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups