RAD for C just in API ??

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

RAD for C just in API ??

Post by Kwai chang caine »

Hello at all

First, i wish you all and obviously PB a happy new year
Numerous big code for you (and if it's sharing it's better for KCC :mrgreen: :lol: ) and several new features for the new version of PB 8)

I search a RAD like PB for generate windows and gadget but in C (Not C++)
Furthermore without ressources, just in code (Like PB what)

I have tried several things, but or it's Widget or it's with ressource :(
What i search it's a RAD who generate a style of code like that

Code: Select all

#include <windows.h> // windows header file

// function prototypes
LRESULT APIENTRY CallBackWindows(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);

// Application Instance Handle
HINSTANCE g_hInst;

// using _stdcall the winmain entry
int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR line, int CmdShow)
{
    g_hInst = hInst;
    MSG msg;

   HWND HwndFenetre;

    WNDCLASS wc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = g_hInst;
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL,IDC_ARROW);
    wc.lpszClassName = "Fenetre";
    wc.lpszMenuName = NULL;
    wc.style = CS_HREDRAW|CS_VREDRAW;
    wc.lpfnWndProc = (WNDPROC) CallBackWindows;
    RegisterClass(&wc);

    HwndFenetre = CreateWindow("Fenetre", Titre, WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, g_hInst, 0);
    ShowWindow(HwndFenetre, SW_SHOW);
    UpdateWindow(HwndFenetre);

    while(GetMessage(&msg, 0, 0, 0))
    {
       TranslateMessage(&msg);
       DispatchMessage(&msg);
    }

    return msg.wParam;
}

// function def's
LRESULT APIENTRY CallBackWindows(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    ...........
    return 0;
}
At my mind that not exist....but it's again a little bit christmas time ..no ???? :mrgreen:

Have a good day
ImageThe happiness is a road...
Not a destination
seeker
User
User
Posts: 48
Joined: Fri Nov 01, 2013 2:08 am

Re: RAD for C just in API ??

Post by seeker »

maybe one of those 2:

http://autoc.wolosoft.com/
Auto C - a SuperEdi Add-in version 3.7 - December 3, 2014
Auto C is an easy way for anyone to instantly start working with the C programming language in a Windows environment. It creates a generic SDK C application based around a user interface that you create and edit like a VB form. Drawing controls on a form using a mouse is all you need to do to create a working Windows program in C. Use a toolbox, properties box and property pages to design your program's user interface. Use the WYSIWYG (what you see is what you get) design environment that the classic Visual Basic Editor provides. By using a Form Designer instead of a dialog box editor many things can be done just by pointing and clicking.

http://www.widestudio.org/EE/wsinfo.html
WideStudio is an open source, Integrated Development Environment for desktop applications purely made in Japan. This enables you to develop GUI applications that can run on Windows95/98/Me/NT/2000/Xp/Vista, WindowsCE, Linux, FreeBSD, SOLARIS, MacOSX(w/X11), BTRON, T-Engine, mu-CLinux(wo/X11) in various programming languages such as C/C++, Java, Perl, Ruby, Python,Objective Caml
Since an application is build on MWT(Multi-Platform Widget Toolkit) which runs on multiple platforms, WideStudio applications are all source compatible between these platforms. If you developped an application in C/C++ language, you only need to re-compile the source code to run on a different platform in as native code.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: RAD for C just in API ??

Post by Kwai chang caine »

Thanks a lot seeker, i don't know this 2 apps 8)
I take a look for see if it's what i search.

I know that in C, normally when we need GUI the good way is the ressources.
But if Bill, have create the API it's not for the dog, no ?

Since Thanks to FRED, i have see the API i love it b:mrgreen:
And i think i'm surely not alone...

In fact a RAD like pb, perhaps not exist in C :shock:
Perhaps a good idea for a new project...but it must know C an PB together, and i have already enough difficulty with PB only :oops:

Or start with code of PB and translate it in API in C, is perhaps not also long to programing that start of nothing.

I have also thinking to XML for take the main informations of the GUI (Coordinate , style of gadgets, color, etc..) and use it for generate source code in C just with API..

Full of idea is possible, because so much way exist, in C , it's the jungle, and KCC is not an explorer :lol:

Again thanks and have a "good year"

Image
Last edited by Kwai chang caine on Fri Jan 02, 2015 5:14 pm, edited 2 times in total.
ImageThe happiness is a road...
Not a destination
seeker
User
User
Posts: 48
Joined: Fri Nov 01, 2013 2:08 am

Re: RAD for C just in API ??

Post by seeker »

why not do the gui in pb and call C?
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: RAD for C just in API ??

Post by Kwai chang caine »

What do you mean by call C (Translate it in C) ?
ImageThe happiness is a road...
Not a destination
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: RAD for C just in API ??

Post by IdeasVacuum »

Visual Studio Express can do it - you can use the C++ version for C. It's Windows only though.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
seeker
User
User
Posts: 48
Joined: Fri Nov 01, 2013 2:08 am

Re: RAD for C just in API ??

Post by seeker »

write your c code - test it. make a dll. make a gui with pb and call the dll functions.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: RAD for C just in API ??

Post by Tenaja »

seeker wrote:why not do the gui in pb and call C?
PB's license prohibits using PB as merely a wrapper to access its libraries.
Kwai chang caine wrote:What do you mean by call C (Translate it in C) ?
The way I read it meant using PB as a wrapper for the library.


Addressing the previous suggestions, I would be leary of using WideStudio. I got concerned when it mentioned WindowsCE in the main description, so I looked at the Version History. It looks like development pretty much stopped in 2010.

Auto C, on the other hand, has six from 2014, although that is about half of the typical year. But it is not open source, so if the wolosoft web site closes down, you are frozen.


I use Code::Blocks as my C IDE. It has a built in gui editor plugin, wxSmith, although I have yet to use it, so I cannot comment with experience. However, with a download containing the editor, the gui editor, and a compiler (mingw), it would be worth going through a few tutorials.
http://www.codeblocks.org/
http://wiki.codeblocks.org/index.php?ti ... ith_plugin
Choosing wxSmith pretty much leaves you with wxWidgets, but that is not all bad--it seems a whole lot like PB's setup, since it uses the built in API (especially if you are only targeting one o/s):
https://www.wxwidgets.org/
https://wiki.wxwidgets.org/WxWidgets_Co ... r_Toolkits

Since wxWidgets uses the built-in API, one might assume it could have the same disadvantages that PB has, which is the "lowest common denominator" issue. If that scares you away, go with GTK+, or one of the other toolkits that do not use API.

Which leads me to this: using that last wxWidgets comparison link as a (one-sided) resource, you might be able to find a toolkit that appeals to you, and from there, search for a RAD system.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3943
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: RAD for C just in API ??

Post by wilbert »

You might consider a Basic to C translator like BCX.
It outputs C code from a Basic source just like PB outputs Asm.
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Re: RAD for C just in API ??

Post by fsw »

Or use FreeBasic and activate the C emitter...
All resulting C code will compile with gcc.

I am to provide the public with beneficial shocks.
Alfred Hitshock
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: RAD for C just in API ??

Post by Kwai chang caine »

@Tenaja
Before write this thread, i have take a rapid look me too to wxWidgets in CodeBlock.
At the begining i have believe found what i search, but when i have see the code generated :shock:
First it's C++ (OOP) and i search C code,
And after see several call to Wx library :( and me i search basic and simple function (For feeling me like at my PBHome :mrgreen:) :

CreateWindow()
DestroyWindow()
SendMessage()
ShowWindow()
UpdateWindow()
MessageBox()
etc ..

In fact like i have a little head, and like FRED have the very good idea to keep the structure of the C with PB, i have see it's possible for me to translate PB code in C
For example, for create a window, just need to registry the classe (Not needed in PB) but after the callback is exactely like PB (I love you FRED :mrgreen:)

C have a syntaxe more difficult, but the shape of the code can be translated nearly word by word :D
Sure, a true programmer in C see that strangled me immediately....but he have not see my PB code :mrgreen: :lol:

@All
Thanks a lots all my friends for all this tips 8)
I try it one by one for see if it's that i search to do...
ImageThe happiness is a road...
Not a destination
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: RAD for C just in API ??

Post by Danilo »

For a C-based cross-platform toolkit you could try IUP.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: RAD for C just in API ??

Post by Kwai chang caine »

Whaouuuuhh !!!! You have cut seriously your answer :shock:
You have passed to KCC answer (xxxxxx lines) to Fred answer (One line) :lol: :lol:
I have read your first answer, but like i'm on a phone, i prefer wait for answering you correctly :wink:

First thanks a lot for your help, i hope never you want quit PB and our community because you are one of the pillar of this forum 8)
And that,... even if you are again a little baby... :shock: :lol:
You are one of my heroes, and i want say that to you now....
I think it's important to say the kinds things to everybody before a missfortune come, and after Regrete not have said :cry:
I have see also, you have not your tongue in the pocket (French expression, i don't know if it's exist in english, you say the true things honestly like you think) and i like that too :wink:

After this moment of love :mrgreen: return to our sheeps (Other french expression if you don't understand :wink:)
Image

I don't know it's possible to be again more low level that PB :shock:
I know the ASM is the more low level language after Binary of course...but i don't know this style of language exist.

You have right, you begin to know KCC, and it's already a miracle he can open CodeBlock and create his first window since 8 years he try, leaves, try, leaves and try again ...but the perseverence pay a day, and the last week..KCC have finally understand how a window works in C :shock:
And this day, i have the most happy donkey programmer of the world, and i jump everywhere in my office like a sheep :D
Image
Yes i know...again a SHEEP :lol:

So for try language again more low lewel, i believe i must wait again a bit :mrgreen:

In fact it's crazy nobody have thinking to create a style of RAD, without management of events, but just with an export of the coordinate, parameter, etc ....in plain text...just the informations, a style of WYSIWYG ... :D
After it's easy to use in all the languages, if you have the colours, the name of the control, the parameter, the coordinate, etc ....
Like this :

Code: Select all

Control=Window
Title=Thirst window of KCC :-))
x=10
y=10
Width=100
Height=200
Parameter=NoSize|CenterScreen
ColorBackGround=Red
etc ...
Imagine the number of users if all the langage can use the same GUI maker
Perhaps your link do that ??
I take a look to your IUP immediately :wink:

Again thanks, my SuperBaby hero 8)

Edit
Thanks to your link DANILO, i have found this site with all the GUI makers :shock:
KCC not sleep today :lol:
http://www.atai.org/guitool/
ImageThe happiness is a road...
Not a destination
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: RAD for C just in API ??

Post by Danilo »

Kwai chang caine wrote:Whaouuuuhh !!!! You have cut seriously your answer :shock:
I realized that my answer was completely off-topic. You asked about plain C, and I was talking about other things (OOP etc.)

I'm wondering why you want to use plain C and low-level WinAPI? Just for learning the language?
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: RAD for C just in API ??

Post by Kwai chang caine »

why you want to use plain C and low-level WinAPI?
Simply because i love it :D
Thanks to FRED, i have discovered the API :shock:
Before never i use it in VB6..too much difficult for me :oops:

In fact i love always PB, but my dream has always been to use C...
Since i use PB, always i see MASTERS like you and all friends talking about C
I see, C is everywhere, LINUX, Drivers, Windows DLL, etc....
And for me a true programmer must know less a little bit C/C++/C#
For me just the C is enough and like i hate the OOP..no C++ and C# :wink:

Furthermore the C is the C, the foundation of nearly all the others languages, and me i'm an old nostalgic man...i have always XP :oops: .. but SP3 when even :mrgreen:
My mega dream, is the ASM a day...but i wait already 9 years for create and understand a window in C...for the ASM it's perhaps for my son... :oops:
In fact, that remember me :shock: , it's necessary now for me, to have a son :lol:

Furthermore understanding C, it's understanding much more things in the events of windows, and numerous other things...
I see that since i begin to learn the code of a window in C above ..
After, several things i have not understand in PB, are more simple now

And the last reason, is unfortunately PB is not really knowing in the professionnal word :cry:
And it's also important, in my job to can say a day, i can do a little application in C
Just for learning the language?
Yes i want learning the C, but my passion is GUI.
I want coding the same things with C than with PB
So for that, like i have a little head, i want to have the same tools like PB

I have found CodeBlocks
With debugger 8)
With Code Snippet 8)
With GuiBuider Fluid and WxSmith (Library C++ not create C API code) :(
So, i search a GUIBuilder who create simple API plain C, like PB create PB code, without library and ressources :D

I believe, my wish for 2015, it's time for me, to can understand several things i have never understand before, during the numerous try i have do in C :?
But it's when even usefull to have all the coordinates, options etc...for used my API CreateWindows()
I have see the great Netmaestro never use GUI Builder :shock:
For me it's impossible, just for have the right size, right parameter, i'm forced to try hundred time :?
Just a simple GUI Maker like the first of PB is enough for make the main of the GUI, after all the code of the events is in the CallBack in C, if i have good understanding..

So i search since several days, and nobody have thinking to create a GuiBuider simple, for all languages.
A tool a little bit like all the tools when you need to have the Hwnd of windows, Gadget, etc...a simple tool what...

Everybody coding big and full library, for include in each system, but i have again not found an simple independent tool :cry:
A day, i have see a start of GUIBuider of FALSAM on french forum.
I have not understand it (Normal :oops:)
So i have the idea to create mine, ....

MDesignER...for MouseDesignER !!! :D

I have coding numerous day to create each gadget, one by one...and it's here i have see the courage of FRED :shock:
After several gadgets..i stop my project...because i have not mesured the time, it necessary for finish it :oops:
It's since this time, i admire FRED for have never stopping his project, even if all the days is the same thing :shock: 8)
And now, i have so a little head, i not remember how, i have coding it :|
When i say to you, i'm a true furuncle of the programming :?
Perhaps a day i find the courage to finish it, if i never found a project simple like mine :cry:

Here you see all the gadget i have created in CanvasGadget point by point, with resizing, etc...
The big with the copy of color of GOOGLE is the WebGadget, and the little frame is an imageGadget

Image
Image
Image
ImageThe happiness is a road...
Not a destination
Post Reply