mgsLib  1.3
Mermaja's Graphic Screen. A simple C library to build Windows graphic applications from console programs.
Functions
mrmWidgets.c File Reference

Main code for the MGS Library Widgets. More...

Functions

void mrmWShow (void)
 Handles all the active widgets display activity. More...
 
void mrmWLoop (void)
 Handles all the active widgets working activity. More...
 
General widgets management and help functions

These functions handle generic widgets and provide auxiliary tools.

void mrmWU3DRectangle (int scr, int x0, int y0, int x1, int y1, int col, int type)
 Draws a 3D rectangle with black and white lines on its edges to simulate it to be below or over the screen surface. More...
 
struct mrmWGInfo mrmWVersionData (void)
 Returns the main MrMWidgets System information. More...
 

Detailed Description

Author
Germán Fabregat
Date
October 2017

Function Documentation

◆ mrmWU3DRectangle()

void mrmWU3DRectangle ( int  scr,
int  x0,
int  y0,
int  x1,
int  y1,
int  col,
int  type 
)

The value held by a slider is calculated by means of the linear relation among the max and min values the slider lenght and the position of the cursor. This function sets the new cursor value that most approximates the cursor value if it fits inside the slider, and return the previous value.

Parameters
[in]idxSlider reference number.
[in]valNew value for the slider. It is ignored if the calculated cursor position does not fit inside the slider.
Returns
The old value of the slider or MGS_ERRRESNOEXIST in case the button does not exist.

◆ mrmWVersionData()

struct mrmWGInfo mrmWVersionData ( void  )

Retruns a mrmWGInfo structure holding the major and minor version numbers and the maximum and free number of each widget type. The mrmWGInfo strucuture is formed by 12 integers:

  • vMajor: Version major number
  • vMinor: Version minor number
  • maxSlider: Maximum number of sliders
  • freeSlider: Current number of free sliders
  • maxButton: Maximum number of buttons
  • freeButton: Current number of free buttons
  • maxTextBox: Maximum number of text boxes
  • freeTextBox: Current number of free text boxes
  • maxSelection: Maximum number of selections
  • freeSelection: Current number of free selections
  • maxList: Maximum number of lists
  • freeList: Current number of free lists
Returns
A mgsInfo structure with these values.

◆ mrmWShow()

void mrmWShow ( void  )

This function has to be called once during program iteration to perform all the activities required for the widgets to be correctly drawn on screen. It should be called after clearing the screens containing widgets, usually at the end of the application loop.

Examples:
colorSelect.c, and colorStar.c.

◆ mrmWLoop()

void mrmWLoop ( void  )

This function has to be called once during program iteration to perform all the activities required for the correct functionning of the widgets. It should be called before the widget drawing function, as a part of the working activity of the loop.

Examples:
colorSelect.c, and colorStar.c.