V
V
vhrytsiuk2021-10-18 17:33:29
User interface
vhrytsiuk, 2021-10-18 17:33:29

How to create your own markup language for interface design (C++)?

I wondered how to develop an event-driven library for creating user interfaces based on my own markup language. Can you tell me where to start, what resources to process? I am a 3rd year student and would like to implement this idea in C++.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
HemulGM, 2021-10-18
@HemulGM

Little markup language. The interface is basically the job of controls. They can be displayed (drawn) in different ways (dramatically different). You can use native platform tools, you can make platform-independent ones and draw everywhere on your own according to your own rules. GUI is a very serious thing and very, very much code. Markup is almost the last stage in the development of a graphics library.
Creating the next markup of an existing library is not a thankful and dubious business.
So, to begin with, nevertheless, it is worth describing the desired in more detail. If it's a completely own graphics framework, then this is one question, and if it's for an existing library, then it's completely different.

S
syxme, 2021-10-21
@syxme

A good option is to consider the basic View from Android (it's quite simple and clear there)
3 Stages Measure, Layout, Draw A
minimum of classes is needed.
Rect - This is clear
Bitmap - Base class for images
Canvas - Base class for drawing
Paint - Base class for brush for drawing
Drawable - Base class for graphic object
MotionEvent - Base class for passing events for ui(widget) elements
View - Base class ui (widget)
Context - Base
Window context - Base window class with event loop
Handler- The system for passing events to the processing queue of the ui thread
MessageQueue - Event loop (in fact, an array of lambdas for executing them in the ui thread)
LayoutInflater - A class for creating a tree of widgets from xml
Further, it is even more difficult, you need to make different widgets from the base View, such as TextView, EditView , ImageView...
As well as widgets for marking child widgets (Linear, Absolute, Table, etc.)
You can draw everything on Direct2d, it's better to take direct2d 1.0 (there is a very simple initialization), in the future it will be possible to switch to a new version
Good luck )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question