Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6944881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:21:53+00:00 2026-05-27T13:21:53+00:00

I would like to program a WYSIWYG editor for HTML. I’m looking for a

  • 0

I would like to program a WYSIWYG editor for HTML. I’m looking for a high level approach, which I will eventually be implementing in C++.

My initial approach is to create a hierarchy of classes which extend a common base class (node). So object “body” would contain object “p” which would contain object “b” which would contain some text.

class node {
    node *parent;
    vector<node> children;

    string name;
    map<string,string> attributes;
    string text;

    virtual void render(const rect &rect, const point &offset) = 0;
    virtual void onEvent(const event &e);
}

The main engine would call something like body.render(screen, point(0, 0)), which would recursively render its children.

The cursor would be represented by a pointer into the object hierarchy, and each node would have its own internal cursor state, and would respond to keyboard events when it is the selected node.

For example, if the user hits the left-arrow, and the “p” node is selected, the “p” node’s reaction to the keypress might be to change the current node to the parent of “p”.

Abstractly, it seems like this could work, the closest thing I can find to what I’m looking for is Sigil, which at first glance seems pretty intimidating to study (main.cpp is 70k).

Before I go down this road, I was wondering if anyone had a simpler approach, or can see any pitfalls with this method.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:21:54+00:00Added an answer on May 27, 2026 at 1:21 pm

    A simpler approach, if you can do this, is to embed a web browser in your application and set contentEditable="true" on <body>. If you’re on Windows, you can use the built-in one, or you can embed an engine like Gecko or WebKit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to program a computer game which should be played by several
I would like to write a program that will identify a machine( for licensing
I would like to monitor my program which is running on the web server.
I would like to write a small program in C# which goes through my
I would like to program a image picker which should choose an image from
i would like to program a little app that will change the colors of
I would like to program in java two Boolean variables which are corelated in
I would like my program to update itself (downloading a new exe and/or some
I would like my program to email me a bug-report when it fails. Is
I would like my GWT program to be able to determine whether it's in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.